Author Topic: Sound output method  (Read 5085 times)

G

  • *
  • Posts: 104
  • , kupo.
    • View Profile
Sound output method
« on: 2007-02-13 19:36:59 »
All that movie stuff brings in my head problem with sound system we wiil use in q-gears.
Definitely q-gears must be crossplatform, so I think the best choice is SDL. SDL have built-in methods for output audio, but in FF7 we can have different sound channels play simultaneously (for those, who don't know what I am talking about, if any ;) - at first watch FF7 opening movie on PSX/Emulator - there is a sound theme beginning, when Aeris coming out from a passage; after this try to watch this movie using any PC PSX video player - you will hear only background noise).
So we need to do some mixing... I understand, that unnecessary project dependencies is a bad idea (right, halkun? :-D). But there is SDL_mixer library...  :evil:. Of course we need only 2 channels of audio (or maybe not?) and we can do mixing manually, but I don't know much about this yet, and I think this will take some time to write good methods for mixing. As we don't have FF7 game sound decoder yet we can skip mixing for now, but later we will have a problem.
What community thinks about it?, can we use SDL_mixer?, can we use something else crossplatform? or don't use any mixing?

gigaherz

  • *
  • Posts: 105
    • View Profile
    • gigaherz's shitty stuff
Re: Sound output method
« Reply #1 on: 2007-02-13 19:46:36 »
There is fmod. I personally like it and even tho it's a propetary library, it's free for non commercial uses and supports windows, linux, and macos.

Also it wouldn't be hard to make our own mixer, with different output "modules" for different platforms.

One of the other projects I work in sometimes is a sound plugin for pcsx2 (a ps2 emulator), and it does all the mixing internally, and can output the sound using waveOut, fmod and asio, so I could help you with that.

G

  • *
  • Posts: 104
  • , kupo.
    • View Profile
Re: Sound output method
« Reply #2 on: 2007-02-13 20:18:38 »
Sorry, I am saying this, but I think, that if we can use GNU/GPL code better use it (I have nothing against fmod, except it's license). Own mixer is better thing, but do we need to rewrite module for each platform, if we can simply user higher level API such as SDL?

gigaherz

  • *
  • Posts: 105
    • View Profile
    • gigaherz's shitty stuff
Re: Sound output method
« Reply #3 on: 2007-02-13 20:58:55 »
Oh, well dunno I never bothered to read the license :Pç

We don't need to rewrite ALL, just the output system. so you could have, using an object-oriented interface, an AudioOutput object for each api (like DSoundOutput, OSSOutput, etc...) that just outputs the audio received from a common AudioMixer object.

About SDL_mixer... SDL has this naming convention... I don't like it, I hate reading function names with _ in them, and SDL does it a lot. :P
Other than that it's fine, so if you want to use SDL_mixer then just don't expect me to help too much... :P

G

  • *
  • Posts: 104
  • , kupo.
    • View Profile
Re: Sound output method
« Reply #4 on: 2007-02-13 21:35:48 »
 :-D - I like call_some_function naming convention, but I like callSomeMethod naming convention! I think for C it's better first variant, for C++ second. Just my way of coding. But I think you'll agree, that using SDL_xxx is a LOT easier than writing another output class for each platform. I can write for you wrapper  - you would not see that _ in function calls! :)
I want to decide together what we will use - that is not my choice...

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Sound output method
« Reply #5 on: 2007-02-14 01:00:52 »
I'm all for SDL_mixer too. Actually, we are going to need MOD-type player. I'll need to hunt down the SEQ data format. I only know the container format, but not what's in it. I know in the "raw" form of SEQ music sequences, they use VAG files for the music samples (Kind of like a soundfont) We have the original uncompiled MIDI files from the PC version so if we liberate the data out of the SEQ container, or whater it's in, we can most likely reverse the music pretty easily.

An intresting way to do music is to take some code from an open source PSX emulator, or one of it's audio plugins to make it sound correct. The "Heart" of our sound system might just be an emulated PSX sound chip. How does that sound to everyone?

Giga, of you have an issue with variable_naming, you could always write a wrapper class or something. I personally hate CamelHump variable names, but abided because Akari likes them.

gigaherz

  • *
  • Posts: 105
    • View Profile
    • gigaherz's shitty stuff
Re: Sound output method
« Reply #6 on: 2007-02-14 20:33:18 »
Giga, of you have an issue with variable_naming, you could always write a wrapper class or something. I personally hate CamelHump variable names, but abided because Akari likes them.
Oh don't worry I will help if I think I can... even if I don't like the naming conventions.

But I think you'll agree, that using SDL_xxx is a LOT easier than writing another output class for each platform.
Sure, but I still don't really like it's naming convention. :P

Actually, we are going to need MOD-type player. I'll need to hunt down the SEQ data format. I only know the container format, but not what's in it. I know in the "raw" form of SEQ music sequences, they use VAG files for the music samples (Kind of like a soundfont) We have the original uncompiled MIDI files from the PC version so if we liberate the data out of the SEQ container, or whater it's in, we can most likely reverse the music pretty easily.
Well SEQs are probably more MIDI-style than MOD, that if they didn't just use MIDI data directly, like lots of ps2 games do... in that case it wouldn't be too hard to do one. I wrote a midi disassembler once (converts a midi stream to instruction mnemonics), and from what I know from the psx sound hardware, I think it wouldn't be too hard to make a sequencer. So if there is the need, tell me. :P

An intresting way to do music is to take some code from an open source PSX emulator, or one of it's audio plugins to make it sound correct. The "Heart" of our sound system might just be an emulated PSX sound chip. How does that sound to everyone?
Well as I said I worked on a spu2 plugin (ps2 sound processor), and it's just like the ps1 spu, but doubled, so I know the insides kinda well (and could provide some code if needed, and I have it). From that I would just say emulating the whole spu would be pointless, but if you jsut take the decoder, mixer and effects processing, then it's a nice idea.