don't click here

Voice samples

Discussion in 'Engineering & Reverse Engineering' started by Wasphammer, Jul 24, 2009.

Thread Status:
Not open for further replies.
  1. Wasphammer

    Wasphammer

    Member
    43
    0
    0
    Would it be difficult to insert voice samples into a ROM hack? Just honest-to-god curious.
     
  2. MarkeyJester

    MarkeyJester

    Original, No substitute Resident Jester
    2,258
    527
    93
    Japan
    No, it's not really hard to put voice data into someone else's rom hack as long as you know where to find the right place to put them, but regardless of whether it's possible or not I don't think it's right, it's kinda rude really, I mean I'm sure nobody wants their rom hacks tampered with.
     
  3. Spanner

    Spanner

    I used to do things... Member
    3,369
    183
    43
    United Kingdom
    Falling asleep for once
    I think he means his own, not anyone else's.
    As for your question, it is possible. I believe that you could use PCM for sounds but that I would require some modifications to the sound driver. The other option would be to use DAC if it was for a song, but that can be annoying.
     
  4. MarkeyJester

    MarkeyJester

    Original, No substitute Resident Jester
    2,258
    527
    93
    Japan
  5. Sonic 65

    Sonic 65

    Tech Member
    It depends on whether you need the voice samples playing at the same time as music is playing or not.

    If not, then you could just use my PCM driver here, which supports DPCM-compressed samples (2:1); the technique used for music is very easily adapted to sound effects (just turn the loop flag off =P). If, however, you do need SMPS music as well as the voice samples playing at the same time, you're out of luck for now (although I'm thinking about creating a 2-channel PCM version of my uncompressed driver and integrating it with SMPS, so that things like this would be possible.)

    EDIT:
    ...wait, do you want the voice samples to be part of a song, instead of sound effects? In that case, do what MarkeyJester said.
     
  6. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    10
    0
    being an asshole =P
    The problem with PCM samples is that they tend to get huge. Forget about complex compression schemes such as MP3 or OGG, the Z80 isn't powerful enough to deal with it in real time, and even then don't expect putting much data as you're limited to 4MB (using the mapper with the Z80 can hurt so no 32MB either...).
     
  7. Sonic 65

    Sonic 65

    Tech Member
    Voice samples shouldn't be that huge; even then, a 6-second 16000Hz DPCM-compressed sample is only 40KB, and most voice samples will probably be shorter than 6 seconds.
     
  8. nineko

    nineko

    I am the Holy Cat Tech Member
    6,386
    537
    93
    italy
  9. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    10
    0
    being an asshole =P
    Those sounds are relatively small - we could argue about the percussion samples as well, with that criteria. Try full songs instead, or maybe try to do voice acting on everything, etc. I mean, look at that Sonic 1 PCM hack - it only changes the songs of the six zones, and it already fills up the ROM practically.

    There is a reason why developers were using the FM and PSG back then and limited themselves to use PCM-like samples to percussion in most of the case. Waveforms tend to get huge easily.
     
  10. Wasphammer

    Wasphammer

    Member
    43
    0
    0
    I was thinking more along the lines of "You'll pay for this!" from SAdv3 or something like it.
     
  11. Chilly Willy

    Chilly Willy

    Just pining for the fjords Tech Member
    755
    21
    18
    Heart of NASCAR
    Doom CD32X Fusion
    Funny, I did my own experiments on compressed audio on the MD.
    http://gendev.spritesmind.net/forum/viewto...&highlight=

    To summarize:
    All the arcs below have all the code, a test bin (tested on KEGA, Gens/GS, and real hardware), and use only the Z80 for playback.
    8:1 compressor with improved encoder: musicdemo3.7z
    4:1 compressor: musicdemo2-2.7z
    3:1 compressor: musicdemo4.7z

    All three use several Sonic CD tracks, so you can directly compare the difference the compression makes, but in general, the 3:1 is good for music and high quality sound effects, the 4:1 is good for regular sounds, and the 8:1 is only for when you need heavy compression.

    Test Controls: Up/Down/Left/Right to play a song. A to stop. Start to pause. C to toggle wait on vert blank. Hold B and press up/down/left/right for alternate songs.
     
Thread Status:
Not open for further replies.