How to perform an Internet-based recording session |
|
In order to start recording from an Internet source (either a shoutcast/icecast stream or simply a sound file stored on a web site), the control needs to be initialised: for this purpose it's mandatory a call to the InitRecordingSystem method; the best place to call this method is usually the container form initialisation function: for example, when using Visual C#, it will be the Form_Load function.
After initialization you need to predispose a couple of settings as for any sound card based recording session; the first thing to decide is the output format of the recorded sound: for this purpose you need to set the EncodeFormats.ForRecording property to one of the available encoding formats.
Each encoding format set into the EncodeFormats.ForRecording property have its own settings which can be controlled through sub-properties of the EncodeFormats property: for example, if the chosen encoding format should be ENCODING_FORMAT_WAV you would have to modify settings of the EncodeFormats.WAV property, if chosen encoding format should be ENCODING_FORMAT_MP3 you would have to modify settings of the EncodeFormats.MP3 property and so on for the remaining accepted encoding formats.
Before starting a recording session, you could have the need to resample incoming sound data, for example for reducing the final recording size: for this purpose you should check the EncodeFormats.ResampleMode property and choose which of the available resample modes would best fit your needs.
Now we can start the Internet recording session calling the StartFromURL method which needs to know the output file location: if an absolute pathname is specified it can be a file on the system hard disk or, if the pathname is left empty, recorded sound data are stored inside a memory buffer that can be used at a later time, for example in order to perform a custom encrypting session before saving it to a file on disk.
In a very similar way, there is the possibility to start a recording session from the audio stream of a video clip stored on Youtube: the StartFromYoutube method is provided for this purpose.
As for a regular sound card based recording session, after completing an Internet based recording sessions you have the possibility to start a new one without discarding the existing one: for this purpose you need to define how the new recording session will behave through a call to the SetRecordingMode method: this will allow appending the new recording session to the existing one or inserting/mixing/overwriting the new recording session to a given position of the existing one: see the SetInsertPos, SetMixingPos and SetOverwritePos methods for defining where the new recording session will be inserted/mixed/overwritten. It's important to note that Internet based recording sessions can be merged/mixed with previous recording sessions performed through a sound card or from a disk file.
In case you should need to split the recording session in separate files containing the left and right channels respectively, you could use the StartSplitFromURL method or the StartSplitFromYoutube method. In this case the recording session wouldn't be kept inside the RecordedSound object so the only accepted recording mode, set through the SetRecordingMode method, is REC_MODE_NEW.