Hey guys I have been exploring the audio API and found something about recording from microphone here: https://bitbucket.org/rude/love/src/37e ... ew-default
but frankly the API seems to be not exposed. Any ideas if that is complete and how can be used?
record audio
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: record audio
oh, sorry. found out myself. its deactivated.
Code: Select all
// List of functions to wrap.
static const luaL_Reg functions[] =
{
{ "getSourceCount", w_getSourceCount },
{ "newSource", w_newSource },
{ "play", w_play },
{ "stop", w_stop },
{ "pause", w_pause },
{ "resume", w_resume },
{ "rewind", w_rewind },
{ "setVolume", w_setVolume },
{ "getVolume", w_getVolume },
{ "setPosition", w_setPosition },
{ "getPosition", w_getPosition },
{ "setOrientation", w_setOrientation },
{ "getOrientation", w_getOrientation },
{ "setVelocity", w_setVelocity },
{ "getVelocity", w_getVelocity },
{ "setDopplerScale", w_setDopplerScale },
{ "getDopplerScale", w_getDopplerScale },
/*{ "record", w_record },
{ "getRecordedData", w_getRecordedData },
{ "stopRecording", w_stopRecording },*/
{ "setDistanceModel", w_setDistanceModel },
{ "getDistanceModel", w_getDistanceModel },
{ "setMixMode", w_setMixMode },
{ 0, 0 }
};
Blog herrsch.de
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: record audio
To be more precise, if you look into the minor branch, you can see a fully functioning API there; Audio recording and queueable sources, along with effect objects and tons of other things will come with the next version, 0.11, which will be released sometime in the future.
(You can already try it out by getting the nightly builds)
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
-
- Prole
- Posts: 15
- Joined: Mon Nov 06, 2017 12:38 pm
Re: record audio
Still no latency reporting, or did I miss it? ._.
What's this? What's this? There's violas everywhere!
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: record audio
Depends on what you mean.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
-
- Prole
- Posts: 15
- Joined: Mon Nov 06, 2017 12:38 pm
Re: record audio
When making a rhythm game, you need to know exactly how many samples of delay there are from when you start playing music and when that music is played on a speaker. if the player presses a key at t = 1.123, and the music is at t = 1.223, that might be a good or a perfect hit depending on exactly what the latency is.
In this particular case, the latency to the audio interface for a particular sound should be enough, even though the best thing for audio-focused games (or audio applications) would be to have an actual audio callback where you can fill the buffer with all your audio data yourself.
In this particular case, the latency to the audio interface for a particular sound should be enough, even though the best thing for audio-focused games (or audio applications) would be to have an actual audio callback where you can fill the buffer with all your audio data yourself.
What's this? What's this? There's violas everywhere!
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: record audio
Usually, those games allow you to change the timings so the graphics can be spot-on with the system's added audio latencies.incognito_mage wrote: ↑Sat Nov 11, 2017 11:26 am When making a rhythm game, you need to know exactly how many samples of delay there are from when you start playing music and when that music is played on a speaker. if the player presses a key at t = 1.123, and the music is at t = 1.223, that might be a good or a perfect hit depending on exactly what the latency is.
Queueable sources say hi; consult with the minor branch in bitbucket, or download a nightly release since they're a 0.11 feature yet to be released officially.incognito_mage wrote: ↑Sat Nov 11, 2017 11:26 amIn this particular case, the latency to the audio interface for a particular sound should be enough, even though the best thing for audio-focused games (or audio applications) would be to have an actual audio callback where you can fill the buffer with all your audio data yourself.
You fill those with your own callback, so you can have samplepoint-accurate timing (on the lua-side anyway; the Audio driver will most likely add a bit of latency too, but not much)
The size of the SoundData you use as buffer will of course determine the "lua-side" latency. (including the sample/sampling rate as well)
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: record audio
incognito_mage wrote: ↑Sat Nov 11, 2017 11:26 am When making a rhythm game, you need to know exactly how many samples of delay there are from when you start playing music and when that music is played on a speaker. if the player presses a key at t = 1.123, and the music is at t = 1.223, that might be a good or a perfect hit depending on exactly what the latency is.
In this particular case, the latency to the audio interface for a particular sound should be enough, even though the best thing for audio-focused games (or audio applications) would be to have an actual audio callback where you can fill the buffer with all your audio data yourself.
Coming from someone who developed a rhythm game on Love, I'd say you're looking preeeetty far down the system, and you probably don't need all this to sync game and music.
Using love's Source:tell("seconds")*1000 is probably more than enough for all your needs.
Simply update your logic according to the Tell function result.
After that's done, you may want to look into timer interpolation, so you avoid things being jittery on systems with higher latencies, such as Android, for example.
https://github.com/Sulunia
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 1 guest