Fmod Sound System Engine
#581
Posted 16 June 2011 - 05:58 PM
~Cheers
M.B
#582
Posted 17 June 2011 - 04:08 AM
One Function that have variable/default arguments is FMODSoundAdd, you must pass the stream and 3d option
For every complaint, note the function referred and change the call (eg, pass the missing 0s)
#583
Posted 17 June 2011 - 03:50 PM
GM 8.1 broke the GM calling system for variable arguments. So make sure you always pass all the arguments even the default ones
One Function that have variable/default arguments is FMODSoundAdd, you must pass the stream and 3d option
For every complaint, note the function referred and change the call (eg, pass the missing 0s)
Tedious, but it works. Thanks for getting back to me on that.
~Cheers
M.B.
#584
Posted 17 June 2011 - 06:43 PM
#585
Posted 27 June 2011 - 12:01 AM
I've tried stopping and freeing all sounds pre-save/load, and loading all sounds again (as with Game Start) post-save/load: that at least got the music to play again, but the sound effects still wouldn't play and the game still crashed. Is there a certain way I have to handle save/load functions alongside the FMOD wrapper to prevent game-crashing code loops?
#586
Posted 27 June 2011 - 03:07 AM
...
See "How Do I" links in the first post for saving and loading
#587
Posted 28 June 2011 - 05:12 PM
Someone suggested that perhaps FMOD returns stereo data, so I tried averaging each pair of sample values into one sample, but it still resulted in sped-up audio in the resulting WAV.
So I'm thinking the format is just different. What differences are there from the format the function returns and 8-bit mono?
-IMP
#588
Posted 28 June 2011 - 06:48 PM
I have a question about the FMODInstanceGetWaveSnapshot function. I'm trying to use FMOD to get wave data, then save that as a WAV file. I have the WAV writing all working. The thing is, I'm writing the WAV using 8-bit mono samples at 44100Hz. I thought that, in the step event, querying FMODInstanceGetWaveSnapshot with a size of sampleRate/room_speed would give me the correct buffer data I need (sampleRate is in samples/second, room_speed is in steps/second, so the result should be the correct samples/step). However, when I write a WAV using this data, it's always sped up, making me think either I'm using the function wrong or I've miscalculated.
Someone suggested that perhaps FMOD returns stereo data, so I tried averaging each pair of sample values into one sample, but it still resulted in sped-up audio in the resulting WAV.
So I'm thinking the format is just different. What differences are there from the format the function returns and 8-bit mono?
-IMP![]()
try placing your code in a tight loop
ins = sound play
while(is playing ins)
{
get data ins left
get data ins right
merge values
save data
fmod update
}
this should eliminate any problem related with room speed (to debug)
But I suspect a mismatch in either stereo, mono, sample size
If you go on the fmod forum there are people asking how to properly save wav. I don't support fast reading of the sound as mentioned in the forum but there are math formulas there that will help you.
#589
Posted 28 June 2011 - 10:38 PM
Thanks for responding. If I put it in a while() loop, even for testing, I have no idea how to time it. The WAV needs to sample at a constant rate--in this case, 44100 samples per second. A while() loop will cycle at whatever the computer's clock speed is, right? And there's no way to get that value, nor is is constant, right? So how do I time my samples if it's in a while() loop? As in, how do I calculate the size of the snapshot to use?
I have a question about the FMODInstanceGetWaveSnapshot function. I'm trying to use FMOD to get wave data, then save that as a WAV file. I have the WAV writing all working. The thing is, I'm writing the WAV using 8-bit mono samples at 44100Hz. I thought that, in the step event, querying FMODInstanceGetWaveSnapshot with a size of sampleRate/room_speed would give me the correct buffer data I need (sampleRate is in samples/second, room_speed is in steps/second, so the result should be the correct samples/step). However, when I write a WAV using this data, it's always sped up, making me think either I'm using the function wrong or I've miscalculated.
Someone suggested that perhaps FMOD returns stereo data, so I tried averaging each pair of sample values into one sample, but it still resulted in sped-up audio in the resulting WAV.
So I'm thinking the format is just different. What differences are there from the format the function returns and 8-bit mono?
-IMP![]()
try placing your code in a tight loop
ins = sound play
while(is playing ins)
{
get data ins left
get data ins right
merge values
save data
fmod update
}
this should eliminate any problem related with room speed (to debug)
But I suspect a mismatch in either stereo, mono, sample size
If you go on the fmod forum there are people asking how to properly save wav. I don't support fast reading of the sound as mentioned in the forum but there are math formulas there that will help you.
-IMP
*EDIT* By the way, I've ruled out the possibility this has anything to do with stereo vs. mono, since I'm getting a snapshot of only channel 0 (left channel) and it's still going fast.
*EDIT2* Some more info has come to light. I had been using songs (or the beginnings of songs) to test this, and I always thought the audio was just too fast. But I tested it with a metronome for comparison, and it turns out it's not just fast. It starts out normal speed, then over time it speeds up faster and faster. Does this help you pinpoint the issue?
Edited by IceMetalPunk, 29 June 2011 - 12:23 AM.
#590
Posted 29 June 2011 - 03:25 AM
http://www.fmod.org/...keywords=saving
you could also try the sleep command and the pause
ins = sound play, paused
while(is playing ins)
{
unpause
sleep for the ms matching a frame bit rate
fmod update
pause
get data ins left
get data ins right
merge values
save data
}
I really don't know how to calculate this though
#591
Posted 01 July 2011 - 02:16 AM
...
See "How Do I" links in the first post for saving and loading
Read through it. Didn't realize the scripts I was using also used the built-in save system...
Is the code you listed there the only way to save/load with FMOD? or will anything work as long as I stop and free all sounds before save/load, and load all sounds again after save/load (and as long as it isn't the GM save function)?
#592
Posted 01 July 2011 - 02:24 AM
Is the code you listed there the only way to save/load with FMOD? or will anything work as long as I stop and free all sounds before save/load, and load all sounds again after save/load (and as long as it isn't the GM save function)?
the concept applies for both GM and programmer implemented methods yes
#593
Posted 04 July 2011 - 08:27 AM
Can I got a help?
I need to record voice(mic input), and in real time mix with music on one or both channel (stereo music)...
Of course, final output must one mixed file?
Also, i need to decrease volume of music while I do voice recording, and increase after recording...
It's that possible?
Format of output file can be *.wav or *.mp3 or something else (*.ogg or similar i don't care really)...
#594
Posted 04 July 2011 - 06:21 PM
The mic stuff is in the last demo room or the merge file
#595
Posted 06 July 2011 - 08:16 PM
I dont know if it is possible to record to a file; see the posts above yours.
The mic stuff is in the last demo room or the merge file
Oh... but sims it's possible...
If you change output ( force) to WRITEWAV than is possible to write all channels to one single WAV file...
But you miss something... Where come address where to save... A name of particular WAV file...
Can you fix that?
#596
Posted 06 July 2011 - 10:25 PM
#597
Posted 07 July 2011 - 02:40 PM
I will see with Brandom....
#598
Posted 08 July 2011 - 10:15 PM
FMODInstanceSetFrequency(soundWingsuitinstance,freq*max(1,max(abs(hspeed),abs(vspeed),speed)/5));
Edited by gmcsdobbie, 08 July 2011 - 10:19 PM.
#599
Posted 09 July 2011 - 12:05 AM
soundWingsuitinstance = FMODSoundPlay(sound);
freq = FMODInstanceGetFrequency(soundWingsuitinstance)
step:
FMODInstanceSetFrequency(soundWingsuitinstance,freq * (1 + speed/5));
#600
Posted 09 July 2011 - 09:44 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users









