I want to write an AppleScript that will record a web radio stream into a file.
I don't want to enter all the options through the Streaming/Transcoding Wizard each time I want to record.
It is easy to go through terminal and start recording in VLC with this code:
Code: Select all
/Applications/VLC.app/Contents/MacOS/VLC -q http://174.123.20.131:8050/ --sout '#duplicate{dst=display,dst="transcode{acodec=s16l,ab=192}:standard{mux=wav,dst=/Users/myname/Desktop/bp.wav,access=file}"}'
The Problem (for me) with this method is, that terminal stays open and "hung up" in this process, until I quit VLC, and that I also have to manually quit terminal. I have a hundred windows open, when I work, and I don't want to add to the clutter. Also, I do use terminal for other things, and don't want that window in my face.
So I'm trying to do it all from AppleScript to VLC directly.
This works beautifully, of course:
Code: Select all
tell application "VLC"
OpenURL http://174.123.20.131:8050/
play
next
end tell
The format of the MRL is given as
Code: Select all
[[access][/demux]://]URL[@[title][:chapter][-[title][:chapter]]] [:option=value ...]
So how can I modify that basic AppleScript to tell VLC that I need it to transcode the stream? This are the options, copied from the last window of the Streaming/Transcoding Wizard:
Code: Select all
:sout=#duplicate{dst=display,dst="transcode{acodec=s16l,ab=192}:standard{mux=wav,dst=/Users/myname/Desktop/bp.wav,access=file}"}
Any help is greatly appreciated.