Exile sampled speech on Electron version

bbc micro/electron/atom/risc os coding queries and routines
Post Reply
User avatar
Negative Charge
Posts: 27
Joined: Sat Jan 16, 2021 1:35 pm
Contact:

Exile sampled speech on Electron version

Post by Negative Charge »

Hi all,

Can anyone tell me a way to determine the sample rate / bit depth of the sample data used for the speech found in $.EXILE3 of the Electron version of Exile ?

I’ve managed to extract the data, which I assume is in PCM unsigned format, and its relatively small size suggests it must be a low sample rate and bit depth.

I’m still working my way through the disassembly of the player code, which looks like it turns the speaker into a 1-bit toggle speaker (FE06 set to 0, and the sound generator toggled on and off with FE07) but I’m yet to work out the format of the sample needed and how to create the from Audacity or SOX. The speech data from the file itself plays back fine in the re-assembled code.

Any assistance would be greatly appreciated. Thanks!
User avatar
0xC0DE
Posts: 999
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: Exile sampled speech on Electron version

Post by 0xC0DE »

I was totally into 1bit sampled sounds on the Elk at one point but it's been too long. I need to get back to it. It's really interesting.
I was experimenting with PWM, 1bit DAC, and other techniques.

I found this in my notes about the EXILE format specifically. Maybe it helps.

; format of sample byte: %xxxxyyyy
; (need_to_inspect_same_byte_again is 0 initially)
; if need_to_inspect_same_byte_again==1 then turn sound on for duration measured by %0000yyyy, set need_to_inspect_same_byte_again=0 (i.e. get next byte)
; else get next byte %xxxxyyyy from sample stream and:
; if %xxxxyyyy==%00000000 then we have reached the end of the sample stream
; else if %yyyy==%1111 then turn sound off for duration measured by %xxxx1111, leave need_to_inspect_same_byte_again unchanged (0 i.e. get next byte)
; else if %xxxx==%0000 then turn sound on for duration measured by %0000yyyy, set need_to_inspect_same_byte_again=0 (i.e. get next byte)
; else turn sound off for duration measured by %0000xxxx, set need_to_inspect_same_byte_again=1
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
User avatar
Negative Charge
Posts: 27
Joined: Sat Jan 16, 2021 1:35 pm
Contact:

Re: Exile sampled speech on Electron version

Post by Negative Charge »

Thanks! It helps clarify some of the assumptions I’ve made about the disassembly. It looks like two samples are packed into a byte… so 4 bits representing each sample.

The sample data appears to be 1069 bytes or 2138 samples. The playback time for the sample is about 1.7 seconds which may suggest a sample rate around 1200Hz.

I’ll keep experimenting. Thanks for your very useful input!
Post Reply

Return to “programming”