SaveMusic(id, f$[, fmt, t])
id to the file specified
by f$. The optional argument fmt specifies the format in which the
music should be exported. By default, Hollywood supports the following
two sound formats:
#SNDFMT_WAVE:
#SNDFMT_SVX:Additional sound formats can be made available by plugins.
Note that the music specified by id must be neither playing nor paused;
it must be in stopped state. Also note that the save operation will begin
at the current music position set using SeekMusic().
SaveMusic() accepts an optional table argument that allows you to pass
additional arguments to the function. The following tags are currently
supported by the optional table argument:
Length:
Bitrate:fmt argument supports audio compression
using a specific bitrate, this tag can be used to specify that bitrate.
For the #SNDFMT_WAVE and #SNDFMT_SVX formats this tag doesn't have any effect.
Quality:fmt argument supports audio compression
using a specific quality setting, this tag can be used to specify that quality.
For the #SNDFMT_WAVE and #SNDFMT_SVX formats this tag doesn't have any effect.
Async:True, SaveMusic() will operate in asynchronous mode. This means that
it will return immediately, passing an asynchronous operation handle to you. You can then
use this asynchronous operation handle to finish the operation by repeatedly calling
ContinueAsyncOperation() until it returns True. This is
very useful in case your script needs to do something else while the operation is in progress,
e.g. displaying a status animation or something similar. By putting SaveMusic() into asynchronous
mode, it is easily possible for your script to do something else while the operation is
being processed. See ContinueAsyncOperation for details. Defaults to False.
Adapter:
UserTags:
#SNDFMT_WAVE)@MUSIC 1, "test.mp3" SaveMusic(1, "test.wav")The code above converts the file
test.mp3 from MP3 to WAVE by
using the SaveMusic() command.
@MUSIC 1, "test.mp3"
SaveMusic(1, "test.wav")
handle = SaveMusic(1, "test.wav", #SNDFMT_WAVE, {Async = True})
Repeat
; ...do something here...
Until ContinueAsyncOperation(handle) = True
The code above does the same as the first example but now runs asynchronously,
allowing your script to do something else while saving is in progress.