Page 2 of 2
Re: Obtain the most tiny audio file with a MP3
Posted: Mon Jan 11, 2010 4:00 pm
by Kwai chang caine
Yes i have understand now...
But i want use directly the encoder with PB.
So i can make a runprogram of OGGENC like the FFMPEG
I have see, on your great link also the MPC enc..perhaps it's the same things
Thanks, i try all that
I wish you a good day

Re: Obtain the most tiny audio file with a MP3
Posted: Mon Jan 11, 2010 4:23 pm
by jamirokwai
Kwaï chang caïne wrote:Yes i have understand now...
But i want use directly the encoder with PB.
So i can make a runprogram of OGGENC like the FFMPEG
I have see, on your great link also the MPC enc..perhaps it's the same things
Thanks, i try all that
I wish you a good day

Hi KCC,
I use this encoder in one of my tools via the commandline. However the tool is for Mac OS X, but the command-line itself should be the same...
If you like, I will have a look this evening, how I did this. Means, when I get home, and provide an example.
Re: Obtain the most tiny audio file with a MP3
Posted: Mon Jan 11, 2010 4:43 pm
by Kwai chang caine
Thanks a lot JAMIROKWAI
Because with all this parameters, i don't know exactely what parameters, i must use, for create mono and better tiny sampling for obtain the more little file

Re: Obtain the most tiny audio file with a MP3
Posted: Mon Jan 11, 2010 7:21 pm
by jamirokwai
Kwaï chang caïne wrote:Thanks a lot JAMIROKWAI
Because with all this parameters, i don't know exactely what parameters, i must use, for create mono and better tiny sampling for obtain the more little file

Hiya,
I made my code into something more general... Here you are.
With the options used for ConvertToOgg, this shrinked a 130k file to 6k... Your results may vary.
The Input has to be .wav, I think... My OGGEnc-File (for Mac OS X) was made by Michael Smith of XIPH.
Code: Select all
; Code to convert a test.wav to test.ogg using oggenc
; you may us this snippet however you like, but please give credit :)
; (p) 2009-2010 quadWorks.de
#Quality = 3 ; 3 is Standard, 0 worst, 10 best quality
#minBits = 80 ; 80 is Standard, 16 is worst, 384 is best
#maxBits = 128 ; 128 is Standard, like above
#varBits = 128 ; 128 is Standard, like above, if set to 0, then use from #minBits to #maxBits
#toMono = 0 ; 0 = Stereo, 1 = convert to Mono
#toSample = 0 ; 0 = don't downsample, everything else (11025, 22050, 32000, 44100, 48000) downsample
#inName = "test.wav"
#toName = "test.ogg"
#Path = "c:/your/path/"
; this one produces the command line options for oggenc...
Procedure.s ConvertToOgg(inName$, toName$, Quality, minBits, maxBits, varBits, toMono, toSample)
encode$ = " -q" + Str(Quality)
If varbits = 0
encode$ + " -m" + Str(minBits)
encode$ + " -M" + Str(maxBits)
Else
encode$ + " -b" + Str(varBits)
EndIf
If toMono = 1
encode$ + " --downmix"
EndIf
If toSample <> 0
encode$ + " --resample " + Str(toSample)
EndIf
encode$ + " " + Chr(34) + inName$ + Chr(34)
encode$ + " -o" + toName$
ProcedureReturn encode$
EndProcedure
; really good quality
;encode$ = ConvertToOgg(#InName, #toName, #Quality, #minBits, #maxBits, #varBits, #toMono, #toSample)
;really bad, but small... :
encode$ = ConvertToOgg(#InName, #toName, 0, 16, 32, 0, 1, 11025)
; here you have to set the full path to oggenc, and the full path to the working directory of your test.wav and test.ogg
x = RunProgram(#Path + "oggenc.exe", encode$, #Path, #PB_Program_Open|#PB_Program_Read)
If x <> 0
While ProgramRunning(x)
Debug ReadProgramString(x)
Wend
If ProgramExitCode(x) <> 0
Debug "error"
Else
Debug "success"
EndIf
CloseProgram(x)
EndIf
Re: Obtain the most tiny audio file with a MP3
Posted: Tue Jan 12, 2010 11:32 am
by Kwai chang caine
Thanks a lot JAMIROKWAI
I have try your code
1/ I have put a wave in c:\
2/ I have put OGGENC.exe and the three other file in c:\
3/ I have change the
#Path to c:\
And your code return an error
I have see the value of "encode$" and this is the result
Code: Select all
-q0 -m16 -M32 --downmix --resample 11025 "test.wav" -otest.ogg
Perhaps an error of space with "-otest.ogg" :roll:
I have try this, and nothing better
I have add some chr(34) also...and not better...

Re: Obtain the most tiny audio file with a MP3
Posted: Wed Jan 13, 2010 12:15 am
by jamirokwai
Kwaï chang caïne wrote:Thanks a lot JAMIROKWAI
I have try your code
1/ I have put a wave in c:\
2/ I have put OGGENC.exe and the three other file in c:\
3/ I have change the
#Path to c:\
And your code return an error
I have see the value of "encode$" and this is the result
Code: Select all
-q0 -m16 -M32 --downmix --resample 11025 "test.wav" -otest.ogg
Perhaps an error of space with "-otest.ogg" :roll:
I have try this, and nothing better
I have add some chr(34) also...and not better...

Hi KCC,
I tried the above commandline with a Mono-Wave. OGGEnc.exe does not like to --downmix to Mono, when the file already is in mono... (odd, on Mac OS, this worked with the same wave...)
Download the OGGEnc from
http://www.rarewares.org/ogg-oggenc.php and rename the oggenc2.exe to oggenc.exe. This worked for me when putting oggenc.exe and test.wav to c:\ with the Original code, BUT using this command:
Code: Select all
encode$ = ConvertToOgg(#InName, #toName, 0, 16, 32, 0, 0, 11025)
.
You see the toMono-Part is 0. The result was the very same file test.ogg.
For #Path, you should use "C:\" then. Probably #toName has to give the full path of the output, e.g. c:\myoggs\output.ogg. I didn't test that.
Last idea: try to use oggenc.exe at the command-line with oggenc.exe -q0 -m16 -M32 --downmix --resample 11025 "test.wav" -otest.ogg
Bonne nuit

Re: Obtain the most tiny audio file with a MP3
Posted: Wed Jan 13, 2010 9:44 am
by Kwai chang caine
Thanks thanks JAMIROKWAI
I moove i moove thanks to you and a friend in french forum also interesting by this subject

I have try directly in command line, and that already don't works
But effectively your code works now, i obtain a file of :
Code: Select all
;encode$ = ConvertToOgg(#InName, #toName, 0, 16, 32, 0, 0, 11025) ; Pour 6 Secondes ==> 65 = 16 K
encode$ = ConvertToOgg(#InName, #toName, 0, 8, 16, 0, 0, 8000) ; Pour 6 Secondes ==> 65 = 11 K
encode$ = ConvertToOgg(#InName, #toName, -1, 8, 16, 0, 0, 8000) ; Pour 6 Secondes ==> 65 = 9 K
1/ 16k to an original file of 64 K in 11025 with q=0
2/ 11K to an original file of 64 K in 8000 with q=0
3/ 9K to an original file of 64 K in 8000 with q=-1
I have two questions again ??

1/ Now, believe you that it's possible to go down more ???
I have try 4000 but that don't works
2/ Believe you it's possible to start with a MP3 ????
Thanks to your help
Bonne nuit
Danke .. gute Nacht zu

Re: Obtain the most tiny audio file with a MP3
Posted: Wed Jan 13, 2010 1:25 pm
by jamirokwai
Kwaï chang caïne wrote:Thanks thanks JAMIROKWAI
I moove i moove thanks to you and a friend in french forum also interesting by this subject

Fine
Kwaï chang caïne wrote:I have two questions again ??

1/ Now, believe you that it's possible to go down more ???
I have try 4000 but that don't works
2/ Believe you it's possible to start with a MP3 ????
1. I think, 8000 is the lowest Hz, OGGenc will be able to use.
Smaller is, for that reason, not possible. The smallest is 8000, Mono, 16kbs minRate, and 16kbs maxRate, I think.
2. OGGEnc will only read Raw or Wave, so you have to decode the MP3 first to Wave, and throw the resulting Wave towards OGGEnc
Kwaï chang caïne wrote:Thanks to your help

You're welcome.
Bonne nuit
Danke .. gute Nacht zu

[/quote]

Re: Obtain the most tiny audio file with a MP3
Posted: Wed Jan 13, 2010 2:27 pm
by Kwai chang caine
Thanks for all this explanation...
Now that's clear in my mind

I have reach the limit of compression with OGG
I wish you a very good day
