honky
Junior Member
Posts: 63
|
Post by honky on Feb 13, 2024 5:27:51 GMT -5
Would LB be able to convert: ".mp3" in->: ".wav"? Thank you for.
|
|
|
Post by tsh73 on Feb 13, 2024 6:40:14 GMT -5
|
|
honky
Junior Member
Posts: 63
|
Post by honky on Feb 13, 2024 7:55:30 GMT -5
Thank you for the links, but Houla la, it is not within the reach of the novice that I am. It looks very complicated. I will study the case.
|
|
|
Post by xxgeek on Feb 13, 2024 8:31:16 GMT -5
Honky, if you download www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zipthen unzip it, and go into the bin folder copy the ffmpeg.exe file. Paste that ffmpeg.exe file in the same dir as your .bas file. Your.bas file q$=chr$(34) run "ffmpeg.exe -i ";q$;"Full\Path to your file.mp3";q$;" -acodec pcm_s16le -ac 1 -ar 16000 WhatEverNameYouLikeNoSPACES.wav" end
RUN your .bas file Your new .wav file should be in the same dir as your .bas file when complete. It works - I just did it myself after doing some reading at Anatoly's link.
|
|
|
Post by tsh73 on Feb 13, 2024 9:00:13 GMT -5
Ahhh the magic of command line. If you find a right tool, you command it and it does all the job for you. Very novice-friendly, I think
|
|
|
Post by xxgeek on Feb 13, 2024 9:24:56 GMT -5
Ahhh the magic of command line. If you find a right tool, you command it and it does all the job for you. Very novice-friendly, I think Would be real nice if we could do these types of conversions from the commandline without downloading 3rd party exe files.
|
|
honky
Junior Member
Posts: 63
|
Post by honky on Feb 13, 2024 9:41:24 GMT -5
Thank very much xxgeek
This thing works wonderfully. But how to include "y" (or "N") in the black window? To automate the answer EDIT: If we don't put anything it's automatic
|
|
|
Post by xxgeek on Feb 13, 2024 10:09:52 GMT -5
Thank very much xxgeek
This thing works wonderfully. But how to include "y" (or "N") in the black window? To automate the answer
Good question. That doesn't happen here for me though (Win 10 Pro) The black window opens and closes in a flash. [edit] Oh, I see now. It asks if it already exists. change run "ffmpeg.exe -i " to run "ffmpeg.exe -y -i " - Use -n for no overwrite. In the Run line. If you want to hide that black window put ,hide at the end of the Run line.
|
|
|
Post by xxgeek on Feb 13, 2024 10:27:55 GMT -5
OMG - I just checked ALL options for ffmpeg.exe using:
ffmpeg -h full
at a command prompt.
I've never seen so many options for an exe file before. It must have taken 20+ seconds or more to print them all to the command window on my i7
|
|
honky
Junior Member
Posts: 63
|
Post by honky on Feb 14, 2024 4:46:00 GMT -5
It's weird, at home, at the first test the window remained open with the question: yes (y) or not (n). For the following tests, the window closes on its own by presuming "no". it suits me well.
|
|
|
Post by Gordon Rahman on Mar 7, 2024 18:22:06 GMT -5
I don't know if LB can convert MP3 to WAV. But LB can run MP3 Here is a listing to run MP3 Maybe it's from Alyce - or 'Bare bones MP3 player. 'This demo allows pause/resume, and 'closes MP3 for exit.
nomainwin WindowWidth=190:WindowHeight=130 button #1.b, "Open File",[open],UL,10,10,80,26 button #1.stop, "Stop",[closeSong],UL,100,10,80,26 button #1.pause, "Pause",[pause],UL,10,40,80,26 button #1.resume, "Resume",[resume],UL,100,40,80,26 button #1.exit, "Exit",[quit],UL,100,70,80,26 open "MP3 Player" for window_nf as #1 print #1, "trapclose [quit]"
[loop] wait
[open]
if musicOpen=1 then r$=mciSendString$("close music")
filedialog "select MP3","*.mp3",m$ if m$="" then wait '[loop] m$=GetShortPathName$(m$) r$=mciSendString$("open "+m$+" type MpegVideo alias music") musicOpen=1 r$=mciSendString$("play music") wait 'goto [loop]
[closeSong] r$=mciSendString$("close music") musicOpen=0 wait 'goto [loop]
[quit] if musicOpen=1 then r$=mciSendString$("close music") close #1:end
[pause]
r$=mciSendString$("pause music") wait 'goto [loop]
[resume] r$=mciSendString$("resume music") wait 'goto [loop]
Function mciSendString$(s$) 'Buffer will contain a return string from 'the function, if there is one. buffer$=space$(1024)+chr$(0) calldll #winmm,"mciSendStringA",s$ as ptr,buffer$ as ptr,_ 1028 as long, 0 as long, r as long
'truncate returned string at null character buffer$=left$(buffer$, instr(buffer$, chr$(0)) - 1)
if r>0 then mciSendString$="error" else mciSendString$=buffer$ end if End Function
Function GetShortPathName$(lPath$) lPath$=lPath$+chr$(0) sPath$=space$(256) lenPath=len(sPath$) calldll #kernel32, "GetShortPathNameA",lPath$ as ptr,_ sPath$ as ptr,lenPath as long,r as long GetShortPathName$=left$(sPath$,r) end function
Gordon
|
|