> I think I'm doing something wrong :o) Don't know what though. > Also, I could not find in the documentation how to convert the sample-data > to floats. Now I'm just doing something like > > float_data[index] = (float)input_data[index]; > > where input_data is a short *input_data "array". Is this correct? Or should > I scale the data down to -1.0 <= x <= 1.0?The scaling used by Speex is +- 32767 (16 bits) and the conversion you're doing is right. Have you listened to the output? Does it sound good (compare it to speexenc/speexdec)? Jean-Marc -- Jean-Marc Valin, M.Sc.A. LABORIUS (http://www.gel.usherb.ca/laborius) Université de Sherbrooke, Québec, Canada -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 242 bytes Desc: signature.asc Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20021213/4eabbf71/signature-0001.pgp
> float_data[index] = (float)input_data[index]; > where input_data is a short *input_data "array". Is this correct? Orshould> I scale the data down to -1.0 <= x <= 1.0?JM> The scaling used by Speex is +- 32767 (16 bits) and the conversion JM> you're doing is right. Have you listened to the output? Does it sound JM> good (compare it to speexenc/speexdec)? Ehr, not yet, to be honest :o) I still have to implement that code. But I'm already asking if I'm doing the compression ok since it makes fixing bugs in the decompression-code a lot simpler (what I mean is; that I can depend on the input-data to be correct). --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Could it be, that if I call peex_init_header(&header, rate, 1, mode); with rate set to 22050 that the encoder fails producing garbage? I could not find anything in the documentation on what I should set rate to. --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
> Is the following code correct for compressing audio? The output I get isso> extremely small, but what is more important: if I pass it through zlib, it > gets at least 50% smaller!JM> On regular data, gzip might get a 5% reduction, so I doubt you can get JM> 50% unless you're encoding zeros or doing something wrong... I think I'm doing something wrong :o) Don't know what though. Also, I could not find in the documentation how to convert the sample-data to floats. Now I'm just doing something like float_data[index] = (float)input_data[index]; where input_data is a short *input_data "array". Is this correct? Or should I scale the data down to -1.0 <= x <= 1.0? JM> In normal operation, narrowband is 8000 Hz, wideband is 16000 Hz and JM> ultra-wideband is 32000 Hz, so I'd change the 22050 for something like JM> 12000 (and maybe have above 22050 encoded in ultra-wideband if JM> necessary). Ah, ok, thanks. --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.