Hi again,
Now that the graphics issues of my game project are fixed thanks to you, I've another big issue related to the audio part .
I use PVSNESLib, which is bundled with the wonderful SNESmod library to play sounds and music. I've got an hard time to figure out how to effectively use all those functions, so I may have made newbie mistakes, but, for now:
- I can get a music to play back perfectly (SNESmod is great!)
- I can get sounds effects to play back too, with several issues, detailed below. To play the Sound Effects, I defined a soundbank (of BRRsamples), and during the game I use the Playsound(#sfxID) function to play them back.
Here are my current issues:
1) Only one Sound Effect can be played at time. Each time I call "PlaySound()", it stops the currently playing sound effect, to play the new one. As Skipp and Friends (the only game I know to use SNESmod too) shows a similar behavior, I guess it's normal. But the SNESmod source shows that it can apparently plays 2 samples at the same time when streaming is disabled, although I'm unsure how to do that.
2) Besides that, my Sound Effects plays fine on every emulator, in 60Hz mode. But, when I play my game in 50Hz mode, either on my PAL SNES or in BSNES, most of the sounds samples are "screwed". Sometimes they plays OK, other times they are crackling, glitching or delayed. Indeed, as only one sound can play at a time, my SFX often "cut" each other. On 60Hz, that's not a problem, but in 50Hz, sometime the second sound is played while remnants of the first (interrupted) sound are also played.
I've contacted Mukunda, who was super helpful. He told me that the streaming timings are designed for 60Hz consoles, and not 50Hz ones. The music however plays smoothly both in 50Hz and 60Hz mode, only the sound effects are distorted.
3) I don't understand how to use the "LoadEffect / PlayEffect" functions. Which is too bad because they seem to be a "non-streaming" option to play samples, that could solve my 50Hz issue. Despite my many tries, I can't them to play any of my sound effects. First, I've defined my SoundBank will all the Sound Effect parameters. Then, I use "spcLoadEffect(#sfxID)", wait a bit, then use "spcEffect(pitch, #sfxID, vol*16+pan)". But all I can get with this method are strange "beeps" instead of my sound sample.
Do you know how to effectively use these functions to play Sound Effects?
Regarding memory, during gameplay, I only have about 20KB of Sound Effects (after BRR conversion) and 13KB of music (after SNESMod conversion), so I guess they should all be able to fit inside the SPC memory.
For now, the only critical issue is second one, as it renders the game unplayable on a PAL SNES. On a NTSC one, it's OK even with one sample at a time, although 2 samples at a time would obviously be better if possible.
Do you have any hints or ideas on these issues?
Thanks again a lot for your help!
Now that the graphics issues of my game project are fixed thanks to you, I've another big issue related to the audio part .
I use PVSNESLib, which is bundled with the wonderful SNESmod library to play sounds and music. I've got an hard time to figure out how to effectively use all those functions, so I may have made newbie mistakes, but, for now:
- I can get a music to play back perfectly (SNESmod is great!)
- I can get sounds effects to play back too, with several issues, detailed below. To play the Sound Effects, I defined a soundbank (of BRRsamples), and during the game I use the Playsound(#sfxID) function to play them back.
Here are my current issues:
1) Only one Sound Effect can be played at time. Each time I call "PlaySound()", it stops the currently playing sound effect, to play the new one. As Skipp and Friends (the only game I know to use SNESmod too) shows a similar behavior, I guess it's normal. But the SNESmod source shows that it can apparently plays 2 samples at the same time when streaming is disabled, although I'm unsure how to do that.
2) Besides that, my Sound Effects plays fine on every emulator, in 60Hz mode. But, when I play my game in 50Hz mode, either on my PAL SNES or in BSNES, most of the sounds samples are "screwed". Sometimes they plays OK, other times they are crackling, glitching or delayed. Indeed, as only one sound can play at a time, my SFX often "cut" each other. On 60Hz, that's not a problem, but in 50Hz, sometime the second sound is played while remnants of the first (interrupted) sound are also played.
I've contacted Mukunda, who was super helpful. He told me that the streaming timings are designed for 60Hz consoles, and not 50Hz ones. The music however plays smoothly both in 50Hz and 60Hz mode, only the sound effects are distorted.
3) I don't understand how to use the "LoadEffect / PlayEffect" functions. Which is too bad because they seem to be a "non-streaming" option to play samples, that could solve my 50Hz issue. Despite my many tries, I can't them to play any of my sound effects. First, I've defined my SoundBank will all the Sound Effect parameters. Then, I use "spcLoadEffect(#sfxID)", wait a bit, then use "spcEffect(pitch, #sfxID, vol*16+pan)". But all I can get with this method are strange "beeps" instead of my sound sample.
Do you know how to effectively use these functions to play Sound Effects?
Regarding memory, during gameplay, I only have about 20KB of Sound Effects (after BRR conversion) and 13KB of music (after SNESMod conversion), so I guess they should all be able to fit inside the SPC memory.
For now, the only critical issue is second one, as it renders the game unplayable on a PAL SNES. On a NTSC one, it's OK even with one sample at a time, although 2 samples at a time would obviously be better if possible.
Do you have any hints or ideas on these issues?
Thanks again a lot for your help!