jdrose Posted January 4, 2012 Share Posted January 4, 2012 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 Quote Link to comment Share on other sites More sharing options...
Tjoppen Posted January 4, 2012 Share Posted January 4, 2012 (edited) 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 January 4, 2012 by Tjoppen Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted January 4, 2012 Share Posted January 4, 2012 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. Quote Link to comment Share on other sites More sharing options...
Tjoppen Posted January 4, 2012 Share Posted January 4, 2012 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. Quote Link to comment Share on other sites More sharing options...
jdrose Posted January 5, 2012 Author Share Posted January 5, 2012 Thank you. Quote Link to comment Share on other sites More sharing options...
jdrose Posted January 7, 2012 Author Share Posted January 7, 2012 That is good news, I have around 750 bytes free. What is the best way to convert a sample recording to 4 bit data suitable for the 2600 routine? Quote Link to comment Share on other sites More sharing options...
Rybags Posted January 7, 2012 Share Posted January 7, 2012 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. Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted May 31, 2013 Share Posted May 31, 2013 Unfortunately I seem to have misplaced the binary and the project itself. This annoys me a bit, but hopefully I'll find it later. Did you happen to relocate the ADPCM project? Quote Link to comment Share on other sites More sharing options...
Tjoppen Posted June 1, 2013 Share Posted June 1, 2013 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 YouTube: http://www.youtube.com/watch?v=tEYH1-MY9s8 Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted June 1, 2013 Share Posted June 1, 2013 (edited) 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 June 1, 2013 by SpiceWare Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.