Jump to content
IGNORED

Quadrun Voice Synthesis - How much space needed


jdrose

Recommended Posts

I am interested in adding a two syllable spoken word to the intro page in my game. My inspiration is from Quadrun. First time I have heard speech Synthesis on the Atari 2600 VCS! Pretty cool.

 

Couple of questions. Is the voice truly sythesized or is it a sample playback? If sampled, how many bytes does the playback routine code and sample data require?

 

Thank you,

 

JDR

Link to comment
Share on other sites

See this thread: www.atariage.com/forums/topic/184034-question-digitized-sound-on-atari-2600

Basically, you either bang out PCM data in AUDV0/1 every couple of scanlines (raw or compressed) or you write a really clever encoder that picks AUDFx/AUDCx values every frame that best matches the input audio's spectrum.

 

As for size: A two syllable word is what, half a second? If you use raw 4-bit 8 kHz audio that's 2k of ROM. If you use something like my 1-bit ADPCM encoder that goes down to 512 B + 64 B tables. AUDFx/AUDCx values for 25-30 frames is less than 100 B depending on how you pack them.

Edited by Tjoppen
Link to comment
Share on other sites

If you use raw 4-bit 8 kHz audio that's 2k of ROM. If you use something like my 1-bit ADPCM encoder that goes down to 512 B + 64 B tables.

 

Hmm - with some of the optimizations we recently figured out while working on Stay Frosty 2, I'm planning to try to add back the voice samples in Frantic. My prior routines packed 2 samples per byte, so a 2K sample took 1K to store. If I could drop that down to 512 bytes that would be great. Will have to do some research on ADPCM when I get back to working on Frantic.

Link to comment
Share on other sites

For further comparison, I managed to squeeze a recording of myself saying "Hello world! 1-2-3-4. He saw the cat." into 4k with not a single byte to spare. Unfortunately I seem to have misplaced the binary and the project itself. This annoys me a bit, but hopefully I'll find it later.

Link to comment
Share on other sites

Start with the best quality recording you can in high res sample/bitrate, e.g. 96,000 Hz, 16 bit. If you want to be really exact, use a sample rate that's an exact multiple of your systems HSync frequency.

 

Use something like Audacity to resample it down to 8-bit values and output a raw audio file (it's like a WAV stripped of it's header).

 

I just use an emulator and Atari Basic (8-bit) program to pack the samples. Use a final playback rate that's a fraction of the original.

Then read the file - your 4-bit samples should be averaged values of every N samples of the original.

 

You can fit 2 samples per byte, it's easy to pair them, just multiply the "top" part by 16 and add the "bottom" part.

 

For playback, just maintain a flag byte that has a bit toggled each time a sample plays. The flag byte tells you whether the top or bottom part of the incoming byte should be used, and if a new byte is needed.

 

For best quality playback, either base it on exact position every N scanlines or on a continuous mode hardware timer that runs at a known rate.

Link to comment
Share on other sites

  • 1 year later...

Actually, I turned it into a demo called Sound Coder last year: http://pouet.net/prod.php?which=59283 The download includes source code - feel free to use, though acknowledgement would be nice if you use it in something :)

Thanks! Interesting, I had a 3-month older version of that in my downloads directory.

 

Acknowledgements are a given :)

 

http://www.youtube.com/watch?v=S5huVcpYPzs

 

http://www.youtube.com/watch?v=FjNSrskWngM

Edited by SpiceWare
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...