Home | Forums | What's new | Resources | |
background sound/music || streaming audio |
Madroms - Nov 18, 2007 |
RockinB | Nov 19, 2007 | |||
Ah Madroms, that sounds like you're going to try some real fine stuff, I appreciate that! I should add TrueMotion playback to the extra points list..., if I haven't done it already! To access multiple files at once, you'll have to use streams (as far as I know). The PCM (*.AIF) playback library (from SBL) features memory playback, file playback and stream playback. The latter one enables concurrent use of File reading (using streams, too). The SND library allows stuff like that, too. This one might be too low level for easy use with SGL. With Sequences (midi-like), you can access files while playing sound, too. Beware when using the SBL example code in you SGL game: setting functions for vblank in and out is done different, a more high level. Don't use the SBL function vblInit(), look at the Saturn SoundPlayer source (slIntFunction(my_vblank) PCM Library: Stream playback mode C:\SaturnOrbit\SBL_601\SEGASMP\PCM\SMPPCM2 Stream playback mode (Sample use of each function, CD-ROM XA audio playback) C:\SaturnOrbit\SBL_601\SEGASMP\PCM\SMPPCM5 SND Library: PCM stream playback (using interruption) sample C:\SaturnOrbit\SBL_601\SEGASMP\SND\SMPSND4 Demo of simultaneous playback of CD-DA and PCM stream playback (using interrupts). C:\SaturnOrbit\SBL_601\SEGASMP\SND\SMPSND5 |
RockinB | Nov 22, 2007 | |||||||||||||
Looks like the file is put into high work RAM. Either put the file into low work RAM manually, it starts at address 0x200000 and is 1MByte long. Or, if the file buffer is allocated with bget, make low work RAM visible to bget by bpool(0x200000, 1024*1024); This both assumes that you load the file from CD, before playing it back.
For this, use file(or stream) playback of AIF files. I used Audacity... for creating AIF files. How to use file playback can be seen in my Saturn SoundPlayer... and in Atlas..., too.
About setting the loop function for AIF files, look here: File playback mode (Loop playback): C:\SaturnOrbit\SBL_601\SEGASMP\PCM\SMPPCM4 Memory playback mode (multi-playback, loop playback): C:\SaturnOrbit\SBL_601\SEGASMP\PCM\SMPPCM13 |
Madroms | Nov 22, 2007 | |||
Ok, thanks again Rockin'b, I will check all this this week-end. |
Madroms | Nov 27, 2007 | |||
Ok, I played a lilbit with sound, and it seems to work. Too bad the sound library (sl... functions) is really poor compared to the SBL library. About the PCM structure, does anyone know if the effects are documented somewhere ? I read a lot of dev manuals but didn't find this info. => this part of the structure: Uint8 eflevelR; / * Effect Level (right and mono) * / Uint8 efselectR; / * Number Effects (right and mono) * / I just find that "Effect Level is 0-7, effects are numbered from 0 to 15". Also, about the slPCMParmChange function, I saw your comment, Rockin'b, on your soundplayer, and I also had the same "issue": sound is stopped when calling it. Any updates or more documentation about how to really use this function, and why it has been made ? At least, can I use SBL functions like PCM_SetLoop if I use sl functions to load/play PCM or it is exclusive: PCM_... functions or sl... functions, not both ? Thanks |
antime | Nov 28, 2007 | |||||
The manual is very unclear on this, but AIUI these correspond to the sound slot EFSEL and EFPAN registers. Bizarrely they control the DSP output slot mixer settings, which not connected to the sound slots they are set in. So the settings in the structure do not seem to be very useful at all, and its a mystery why they're included at all. |
Madroms | Nov 30, 2007 | |||
Thanks antime, so I must test these to see if they do something, not that I need them, but just that I am curious |
rorirub | Dec 2, 2007 | |||
You could possibly use ADPCM reduce the filesize by 1/4. Although I'm not sure if those would be playable without loading an extra library required for decoding the data. Also the only two adpcm formats I've seen the Saturn handle are DUCK and ADX. |
Madroms | Dec 3, 2007 | |||
I didn't play with DUCK for now but it could be a great way to look at. For ADX, I didn't remember if we have some sources about it. I just got a HDD failure this week-end, the one with the OS and all my sources code, db and such. Luckily, I was able to recover all the data (ouf!), I just spent all my week-end to reinstall XP on a new HD, reinstall all the soft and recover all my data. So it is 2 days lost for coding, so I will probably not have time to implement DUCK playback on my project. I have too much things to do before (like taking a shitloads of screenshots and more than 200 PCM samples...) |
antime | Dec 3, 2007 | |||
You can find detailed descriptions of many ADPCM variants in the Multimedia Wiki..., including both Duck and ADX. |
rorirub | Dec 8, 2007 | |||
We have ADX encoders and tools on some Dreamcast devkits but I'm not sure those are useable for the Saturn. |