|
Rockbox mail archiveSubject: Re: voice UI step 4 now has talkbox, and moreRe: voice UI step 4 now has talkbox, and more
From: Brian Wolven <brian.wolven_at_verizon.net>
Date: Tue, 30 Mar 2004 10:21:06 -0500 [IDC]Dragon wrote: >>To support the talkbox clips, the following line in the mp3clipgen >>script should also be changed to >> >> Const AUDIO_FORMAT = 30 ' 16-bit 32 kHz Mono >> >>The old value was 22. > > Yes, I did that in my mirror of the script: > http://joerg.hohensohn.bei.t-online.de/archos/speech/mp3ClipGen.vbs > > The value is a strange code, this is not directly readable as the sample > rate. > > I'll try something similar for the next version of the voice file, if 32 kHz > still fits all the clips in the mp3 buffer. Plus we need some headroom for > the worst-case talkbox clip length. It is a bit odd. I suppose you can harvest that information from the include files in the speech SDK, but I've just been looking at the following function (from http://www.ericphelps.com/scripting) that provides the gory details: Function SAFT(lngSpeechAudioFormatType) 'Returns a text description of the format type 'Values from SpeechLib.SpeechAudioFormatType Dim strSAFT, lngSAFT 'Preserve input variable lngSAFT = lngSpeechAudioFormatType 'Stop bad input If Not IsNumeric(lngSAFT) Then SAFT = "Unknown" Exit Function End If If lngSAFT < 4 Or lngSAFT > 68 Then SAFT = "Unknown" Exit Function End If 'NORMAL for values between 0 and 39 'stereo = add 1 '16-bit = add 2 '8KHz = 4 '11KHz = 8 '12KHz = 12 '16KHz = 16 '22KHz = 20 '24KHz = 24 '32KHz = 28 '44KHz = 32 '48KHz = 36 If lngSAFT < 40 Then lngSAFT = lngSAFT - 4 'Offset so it starts at zero strSAFT = Split("8 11 12 16 22 24 32 44 48")(lngSAFT \ 4) & "KHz" strSAFT = strSAFT & " " strSAFT = strSAFT & Split("8 16")((lngSAFT And 2) \ 2) & "bit" strSAFT = strSAFT & " " strSAFT = strSAFT & Split("Mono Stereo")(lngSAFT And 1) End If 'TrueSpeech_8kHz1BitMono = 40 If lngSAFT = 40 Then strSAFT = "TrueSpeech 8KHz 1bit Mono" End If 'stereo = add 1 to below values 'CCITT_ALaw for values between 41 and 48 '8KHz = 41 '11KHz = 43 '22KHz = 45 '44KHz = 47 'CCITT_uLaw for values between 49 and 56 '8KHz = 49 '11KHz = 51 '22KHz = 53 '44KHz = 55 'ADPCM for values between 57 and 64 '8KHz = 57 '11KHz = 59 '22KHz = 61 '44KHz = 63 If ((lngSAFT > 40) And (lngSAFT < 65)) Then lngSAFT = lngSAFT - 41 'Offset so it starts at zero strSAFT = Split("CCITT_ALaw CCITT_uLaw ADPCM")(lngSAFT \ 8) strSAFT = strSAFT & " " strSAFT = strSAFT & Split("8 11 22 44")((lngSAFT \ 2) And 3) & "KHz" strSAFT = strSAFT & " " strSAFT = strSAFT & Split("Mono Stereo")(lngSAFT And 1) End If 'GSM_610 for values between 65 and 68 (no stereo) '8KHz = 65 '11KHz = 66 '22KHz = 67 '44KHz = 68 If lngSAFT > 64 Then Select Case lngSAFT Case 65 strSAFT = "GSM_610 8KHz Mono" Case 66 strSAFT = "GSM_610 11KHz Mono" Case 67 strSAFT = "GSM_610 22KHz Mono" Case 68 strSAFT = "GSM_610 44KHz Mono" Case Else strSAFT = "Unknown" End Select End If 'Return the value SAFT = strSAFT End Function _______________________________________________ http://cool.haxx.se/mailman/listinfo/rockbox Received on 2004-03-30 Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy |