Computing > Embedded Computing

Modifying BT Speaker firmware

<< < (4/5) > >>

Crawlie69:
Wow neil! I'm really amazed at your work. Incredible how you solved the problem so fast! Multiple very competent people i've spoken with has not been able to identify the format of the files.

Thank you very, very much! I really appreciate it.

I will give an update once i've succesfully replaced some of audio. Again - Thank you so much!! :-+  ;D

Crawlie69:
Hey Neil - Can you run me through an example of using sbcdec? No matter what or how i try, it seems like it wants me to specify an output file, and even if i then make an empty file and use the -f command i cannot make it work.  :D

Crawlie69:
Got it working. Oddly enough i had to decode them as following: sudo sbcdec -f bluetooth_cn_decoded bluetooth_cn

Bluetooth_cn being the file i want to decode, and bluetooth_cn_decoded being the output file. Seems like it has worked though as the output file is larger in volume, and i'm actually able to play the sound.


Looking at sbcenc is even more confusing though. I tried encoding one of the decoded files, but haven't been succesful though.  ;D

neil555:
Hmmm, dunno why you needed to use sudo to run sbcdec, i was using linux mint and it just worked!

To decode a file ...

sbcdec -f outfile.snd infile.sbc  (or infile.mp3 if using the extracted files from the firmware)

To re-encode the files after decoding ....

sbcenc -v -s 8 -B 16 -b 33 infile.snd >outfile.sbc


The files produced when decoding or used for encoding are in .snd format (16 bit big endian PCM), Cooledit (windows) can load and save in this format however Audacity can't.  If using Audacity then i would recommend converting the .snd files into .wav (to play the decoded files) and converting from .wav to .snd (for encoding)

To install sox ...

sudo apt-get install sox

To convert from .wav to .snd ...

sox infile.wav outfile.snd

To convert from .snd to .wav ...

sox infile.snd outfile.wav


 

fzabkar:
There is an "official" Windows encoder/decoder tool which converts between WAV (RIFF) and SBC formats (found by "HaQue" in a related thread).

https://files.catbox.moe/29l4kd.zip
https://habr.com/en/post/456182/

This command decodes all the ".mp3" files in the current directory and saves them as WAV files in the Decoded subdirectory:


--- Code: ---for %i in (*.mp3) do sbc_decoder -v -oDecoded\%i.wav %i
--- End code ---

The "-v" switch (verbose) is optional.

Sample output:


--- Code: ---SBC Decoder LIB Version 1.5
Copyright (c) 2002  Philips Consumer Electronics, ASA Labs

sbc_info: pos: 0 fs: 16000 blk_len:  16 mode: 0 channels: 1 snr: 0 bands: 8 pool: 33
bitpool =     33
frmlen  =     74 bytes
bitrate =  74.00 kbps
Decoded frames: 99
--- End code ---


--- Code: ---9.4.4.1 Reference SBC Encoder Version 1.5
Usage:
sbc_encoder [-jsv] [-lblk_len] [-nsubbands] [-p] [-rrate] [-ooutputfile] inputfile
[-s] use the stereo mode for stereo signals
[-v] verbose mode
[-j] enables the use of joint coding for stereo signals
[-lblk_len] blk_len specifies the APCM block length, out of [4,8,12,16]
[-nsubbands] subbands specifies the number of subbands, out of [4,8]
[-p] a simple psycho acoustic model is used (preferred)
[-rrate] specifies the bit rate in bps
[-ooutputfile] specifies the name of the bitstream output file inputfile specifies the audio input file, the major audio formats are supported
Example:
sbc_encoder -j -n8 -l16 –p –r279000 -ofile.sbc file.wav
--- End code ---


--- Code: ---9.4.4.2 Reference SBC Decoder Version 1.5
Usage:
sbc_decoder [-v] [-ooutputfile] [-pstartpos] inputfile
[-v] verbose mode
[-pstartpos] startpos specifies the byte offset to start with decoding
[-ooutputfile] specifies the name of the audio output file inputfile specifies the name of the bitstream input file
Example:
sbc_decoder -ofile.sbc_dec file.sbc
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version