Active Topics

 



Notices


Reply
Thread Tools
Posts: 64 | Thanked: 19 times | Joined on Feb 2008
#1
I was unable to find instructions on the internet on how to recover, or decode, .libc-generated files from Maemo Recorder to another computer.

Thanks to Rich at http://houseofmabel.com/ for the instructions via email.

Instructions:

1.) Download the .exe ilbc script created by Jeffery (from http://www.iconbar.com/forums/viewth...threadid=10868) at http://www.iconbar.com/forums/attach...10868/ilbc.zip (or attached in to this thread in a .zip).

2.) Run the .exe in command line or terminal using wine.
Windows Users: Start --> Run --> type cmd --> cd <folder with input file> --> type ilbctest.exe 30 -decode input_file.ilbc output_file.raw
Linux Users: Terminal --> cd <folder with input file> --> wine ilbctest.exe 30 -decode input_file.ilbc output_file.raw

If you do not know what user you are, you are a Windows User.

The output should look similar to below:

*---------------------------------------------------*
* *
* iLBC test program *
* *
* *
*---------------------------------------------------*

Mode : 30 ms
Input file : -decode
Encoded file : input_file.ilbc
Output file : output_file.raw

--- Decoding block 57636 ---

Length of speech file: 1729.1 s
Packet loss : 0.0%
Time to run iLBC : 31.8 s (1.8 % of realtime)

3.) The script should have provided an output_file.raw in the directory you "cd"ed (changed to). Ensure it is there, or redo steps (1) and (2).

4.) Install audacity from http://audacity.sourceforge.net/download/

5.) Open Audacity --> File --> Import --> Raw Data

6.) In Audacity still, find the file output_file.raw in the directory you "cd"ed (changed to) --> Press the Open button.

7) This step is where Rich and I differed in instructions.

Rich used the following settings (also see in the .zip attached to this forum):

Import Raw Data:
Signed 16 bit PCM
***Big-Endian***
1 Channel (Mono)
Start Offset: 0 bytes
Amount to import: 100%
Sample rate: 8000 Hz

I used the following settings, successfully (also see in the .zip attached to this forum):

Import Raw Data:
Signed 16 bit PCM
**Little-Endian***
1 Channel (Mono)
Start Offset: 0 bytes
Amount to import: 100%
Sample rate: 8000 Hz

Press the Import button.

8.) Hopefully when you play the file using one of the two above methods, the data will sound intact. If not, please report here. If so, please continue to save the file.

9.) File --> Export --> Save (Default is .wav, which is large, but works on all systems)

Hope this guide helped.

Regards,
John
Attached Files
File Type: zip screenshots_and_program.zip (245.9 KB, 558 views)
 

The Following 4 Users Say Thank You to johndoe32102002 For This Useful Post:
Posts: 227 | Thanked: 53 times | Joined on Feb 2008 @ Lyon, France
#2
Originally Posted by johndoe32102002 View Post
1.) Download the .exe ilbc script created by Jeffery (from http://www.iconbar.com/forums/viewth...threadid=10868) at http://www.iconbar.com/forums/attach...10868/ilbc.zip (or attached in to this thread in a .zip).
It isn't a script, but a MS-Windows executable. The sources are provided too, so that they can be recompiled with something like:
Code:
gcc -Wall -O2 *.c -o iLBC_test
Jeffrey Lee said that this is a slightly modified version of the reference implementation from RFC3951 (the iLBC web site provides an awk script to extract the source).

FYI, I tried this reference implementation in May, but without any success, because the instructions were very unclear. I think I can now understand, after looking at the sizes of the files (iLBC is about 10 times as small as 16-bit raw data): the reference implementation, which takes an input file and generates two output files (encoded, 10 times as small, and decoded, about the same size of the original file), seems to do iLBC encoding then re-decode to PCM (or whatever). This is clearly not what we want. Hence the slightly modified version by Jeffrey Lee, with which one can use either encode or decode mode (here we are interested in the second one).

Originally Posted by johndoe32102002 View Post
2.) Run the .exe in command line or terminal using wine.
Windows Users: Start --> Run --> type cmd --> cd <folder with input file> --> type ilbctest.exe 30 -decode input_file.ilbc output_file.raw
Linux Users: Terminal --> cd <folder with input file> --> wine ilbctest.exe 30 -decode input_file.ilbc output_file.raw
I don't want to use wine (and I'm not even sure I can). Anyway a compilation is only what is needed: the RFC claims that this implementation is portable, and I suppose that the modifications done by Jeffrey also are. At least, this seems to work well.

Originally Posted by johndoe32102002 View Post
7) This step is where Rich and I differed in instructions.
The only difference is the endianness. Perhaps Rich recompiled the software on a big-endian machine. This is what I did (on my PowerPC-base Mac) and importing as big-endian signed 16-bit PCM 8kHz works for me.
 
Posts: 18 | Thanked: 1 time | Joined on Apr 2008
#3
Great it works!!!

Note: my 6MB ilbc, some 70 min converted to 30MB MP3 file
 
Posts: 227 | Thanked: 53 times | Joined on Feb 2008 @ Lyon, France
#4
Originally Posted by winpisces View Post
Note: my 6MB ilbc, some 70 min converted to 30MB MP3 file
You can greatly reduce the quality of the MP3 file so that it takes much less space, without losing too much.
 
Posts: 232 | Thanked: 32 times | Joined on Jul 2009 @ Idaho
#5
I hate to necro post stuff, but I tried this and all I ever get is a blank file. I need to decode this... I didn't want to record as a wav file (as I think it comes out HUGE), so I chose iLBC... now I need these (as they are job training notes).
__________________
If my posts have a few misspellings or other errors, it's probably cause I'm pounding out words at the speed of insanity on my N810.
http://last.fm/mgamerz
http://twitter.com/mgamerz
http://youtube.com/mgamerz
 
www.rzr.online.fr's Avatar
Posts: 1,348 | Thanked: 1,863 times | Joined on Jan 2009 @ fr/35/rennes
#6
Originally Posted by vinc17 View Post

Hence the slightly modified version by Jeffrey Lee, with which one can use either encode or decode mode (here we are interested in the second one).
that version build on linux
gcc -o ilbctest -lm *.c

can it be distrib for maemo as well ?

FYI here are the diff

<code>
# cat ilbc-dec.patch
diff -u -BurNw ilbc/iLBC_test.c ilbc-dec/iLBC_test.c
--- ilbc/iLBC_test.c 2010-07-28 01:36:54.000000000 +0200
+++ ilbc-dec/iLBC_test.c 2008-06-17 23:58:44.000000000 +0200
@@ -172,10 +172,8 @@
argv[1]);
exit(2);
}
- if ( (ifileid=fopen(argv[2],"rb")) == NULL) {
- fprintf(stderr,"Cannot open input file %s\n", argv[2]);
- exit(2);}
- if ( (efileid=fopen(argv[3],"wb")) == NULL) {
+ ifileid=fopen(argv[2],"rb");
+ if ( (efileid=fopen(argv[3],(ifileid?"wb":"rb"))) == NULL) {
fprintf(stderr, "Cannot open encoded file %s\n",
argv[3]); exit(1);}
if ( (ofileid=fopen(argv[4],"wb")) == NULL) {
@@ -231,6 +229,9 @@

/* loop over input blocks */

+ if(ifileid)
+ {
+
while (fread(data,sizeof(short),Enc_Inst.blockl,ifileid) ==
Enc_Inst.blockl) {

@@ -282,6 +283,52 @@

fwrite(decoded_data,sizeof(short),len,ofileid);
}
+ }
+ else
+ {
+ fseek(efileid,0,SEEK_END);
+ int inlen = ftell(efileid);
+ int inpos=0;
+ char *input = malloc(inlen);
+ fseek(efileid,0,SEEK_SET);
+ fread(input,1,inlen,efileid);
+
+ while (inpos < inlen) {
+ blockcount++;
+ /* get channel data if provided */
+ if (argc==6) {
+ if (fread(&pli, sizeof(short), 1, cfileid)) {
+ if ((pli!=0)&&(pli!=1)) {
+ fprintf(stderr, "Error in channel file\n");
+ exit(0);
+ }
+ if (pli==0) {
+ /* Packet loss -> remove info from frame */
+ memset(encoded_data, 0,
+ sizeof(short)*ILBCNOOFWORDS_MAX);
+ packetlosscount++;
+ }
+ } else {
+ fprintf(stderr, "Error. Channel file too short\n");
+ exit(0);
+ }
+ } else {
+ pli=1;
+ }
+
+ /* decoding */
+
+ fprintf(stderr, "--- Decoding block %i --- ",blockcount);
+
+ len=decode(&Dec_Inst, decoded_data, &input[inpos], pli);
+ fprintf(stderr, "\r");
+
+ /* write output file */
+
+ fwrite(decoded_data,sizeof(short),len,ofileid);
+ inpos += Dec_Inst.no_of_bytes;
+ }
+ }

/* Runtime statistics */

@@ -301,7 +348,7 @@

/* close files */

- fclose(ifileid); fclose(efileid); fclose(ofileid);
+ if(ifileid) fclose(ifileid); fclose(efileid); fclose(ofileid);
if (argc==6) {
fclose(cfileid);
}
</code>
__________________
Current obsession:

https://purl.org/rzr/abandonware

Please help to list all maemo existing apps :

https://github.com/abandonware/aband...ment-578143760

https://wiki.maemo.org/Apps#

I am looking for " 4 inch TFT LCD display screen " for Nokia n950 HandSet

http://rzr.online.fr/q/lcd


Also, I need online storage to archive files :

http://db.tt/gn5Qffd6#

https://my.pcloud.com/#page=register...e=g8ikZmcfEJy#

Last edited by www.rzr.online.fr; 2010-07-27 at 23:42.
 
Posts: 3 | Thanked: 1 time | Joined on Oct 2009
#7
I wrote a Makefile that will download all the files, generate the sources, and build a command line util called ilbc-decode. This should work on any system that uses the GNU build tools, so Mac OS X, GNU/Linux, Windows/Cygwin, Windows/MinGW, and the BSDs.

To use, run these lines in the Terminal:
gunzip Makefile.gz
make generate-sources
make
make install
ilbc-decode

Also, if you are on Mac OS X, you can use Fink to install it:
fink install ilbc-decode
Attached Files
File Type: gz Makefile.gz (683 Bytes, 538 views)
 
Reply


 
Forum Jump


All times are GMT. The time now is 08:26.