PrimoBurner for .NET  4.6
CD, DVD and Blu-ray Software Development Kit
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
AudioCD Class Reference

AudioCD burns audio CDs from files like MP3, WMA, WAV and other formats. More...

Inherits IDisposable.

Public Member Functions

 AudioCD ()
 Creates an AudioCD instance. More...
 
CDSession CreateCDSession ()
 Creates a CDSession object from the current audio input list. More...
 
void Dispose ()
 Disposes AudioCD and reclaims the resources used by the object. More...
 
int GetInputLength (AudioInput input)
 Returns the estimated size of the AudioInput in CDDA blocks (frames). More...
 
bool ReadFromCD (int trackNumber, AudioOutput output)
 Reads the specified audio track into a file/stream. More...
 
bool ReadFromCD (int startLba, int blocks, AudioOutput output)
 Reads the specified audio region into a file/stream. More...
 
bool WriteToCD ()
 Writes the current track list to a CD. More...
 

Properties

AudioDecodingMethod AudioDecodingMethod [get, set]
 Gets/Sets the audio decoding method. More...
 
IList< AudioInputAudioInputs [get]
 Gets a list of audio inputs. More...
 
CDSession CDSession [get, set]
 Gets/Sets a CDSession that will be used when writing in Session-At-Once mode (WriteMethod.Sao). More...
 
CDText CDText [get, set]
 Gets/Sets a CDText object with the CD-TEXT data that should be written to the CD. More...
 
bool CloseDisc [get, set]
 Indicates whether to close the disk after the current session is completed. More...
 
Device Device [get, set]
 Gets/Sets the device that this object will use. More...
 
ErrorInfo Error [get]
 The error information for the last AudioCD operation. More...
 
AudioInput ErrorInput [get]
 Gets the audio input that caused an error. More...
 
int SessionLength [get]
 Gets the session length in CDDA blocks (frames). More...
 
bool SimulateBurn [get, set]
 Indicates whether to perform simulation instead of real burning. More...
 
WriteMethod WriteMethod [get, set]
 Gets/Sets CD write method. More...
 

Events

EventHandler
< AudioCDContinueEventArgs
OnContinueRead
 Raised to check if reading should continue. More...
 
EventHandler
< AudioCDContinueEventArgs
OnContinueWrite
 Raised to check if burning should continue. More...
 
EventHandler
< AudioCDProgressEventArgs
OnReadProgress
 Raised to report the number of CDDA blocks read from the CD. More...
 
EventHandler
< AudioCDStatusEventArgs
OnReadStatus
 Raised to report the reading status. More...
 
EventHandler
< AudioCDProgressEventArgs
OnWriteProgress
 Raised to report the number of CDDA blocks written to the CD. More...
 
EventHandler
< AudioCDStatusEventArgs
OnWriteStatus
 Raised to report the burning status. More...
 
EventHandler
< AudioCDTrackStatusEventArgs
OnWriteTrack
 Raised to report the burning progress for individual tracks. More...
 

Detailed Description

AudioCD burns audio CDs from files like MP3, WMA, WAV and other formats.

It also rips audio CD tracks into compressed and uncompressed audio formats.

When the AudioCD object is not needed anymore it should be disposed in order to deterministically reclaim the allocated resources.

Constructor & Destructor Documentation

AudioCD ( )

Creates an AudioCD instance.

When the AudioCD object is not needed anymore it should be disposed in order to deterministically reclaim the allocated resources.

Member Function Documentation

CDSession CreateCDSession ( )

Creates a CDSession object from the current audio input list.

Returns
A CDSession object. null if the CDSession object could not be created. In this case the last error is set to AudioCDError.InputError.

NOTES: The returned CDSession object may be additionally manipulated and indexes can be added to the existing tracks. If you change it you need to set it explicitly via AudioCD.CDSession before calling the WriteToCD method.

AudioCD will validate and use the CDSession object set via the AudioCD.CDSession property only if the write method is WriteMethod.Sao (Session-At-Once).

There is no need to create, modify and set a CDSession object when the write method is WriteMethod.Tao (Track-At-Once), because AudioCD will ignore it.

See Also
AudioInputs
void Dispose ( )

Disposes AudioCD and reclaims the resources used by the object.

int GetInputLength ( AudioInput  input)

Returns the estimated size of the AudioInput in CDDA blocks (frames).

Parameters
inputThe input for which size should be calculated.
Returns
The size of the input in blocks (frames). The size of an audio block (frame) is BlockSize.Cdda (2352) bytes.
bool ReadFromCD ( int  trackNumber,
AudioOutput  output 
)

Reads the specified audio track into a file/stream.

Parameters
trackNumberSpecifies which track shall be ripped. Tracks are numbered from 1 to 99. Audio CD standard allows up to 99 tracks.
outputSpecifies the output audio format and where the audio shall be written. The output audio format is determined by the file/stream extension. The ripped and encoded audio is written to the specified output (file or stream). The output may be null in which case the audio is read from the CD but is thrown away.
Returns
true if the operation is sucessfull; otherwise false.
bool ReadFromCD ( int  startLba,
int  blocks,
AudioOutput  output 
)

Reads the specified audio region into a file/stream.

Parameters
startLbaSpecifies the Logical block address where the reading begins. The first readable LBA is 0.
blocksSpecifies how many blocks to read.
outputSpecifies the output audio format and where the audio shall be written. The output audio format is determined by the file/stream extension. The ripped and encoded audio is written to the specified output (file or stream). The output may be null in which case the audio is read from the CD but is thrown away.
Returns
true if the operation is sucessfull; otherwise false.
bool WriteToCD ( )

Writes the current track list to a CD.

Returns
true if sucessful; otherwise false

Property Documentation

Gets/Sets the audio decoding method.

IList<AudioInput> AudioInputs
get

Gets a list of audio inputs.

The order of the inputs in the list determines the sequence of the audio content written to the audio CD.

Gets/Sets a CDSession that will be used when writing in Session-At-Once mode (WriteMethod.Sao).

If CDSession is not set (or null) AudioCD automatically creates a CDSession object when it needs it based on the current audio input list.

CreateCDSession may be used to created a CD session based on the audio inputs.

The session passed to this method may describe a layout that differs from the audio inputs. The number of tracks (CDTrack objects) may differ from the number of audio inputs (AudioInput objects).

CDText CDText
getset

Gets/Sets a CDText object with the CD-TEXT data that should be written to the CD.

CD-TEXT data is encoded in the lead-in area of the CD. CD-TEXT is not supported for TAO, RAW DAO and RAW SAO modes. To disable CD-TEXT recording set this property to null.

bool CloseDisc
getset

Indicates whether to close the disk after the current session is completed.

Set to false to leave the disk open and allow additional sessions to be added to the disk at a later time.

Device Device
getset

Gets/Sets the device that this object will use.

ErrorInfo Error
get

The error information for the last AudioCD operation.

See Also
ErrorInfo
AudioInput ErrorInput
get

Gets the audio input that caused an error.

Use this property when last error is AudioCDError.InputError.

int SessionLength
get

Gets the session length in CDDA blocks (frames).

The returned value is -1 if the session length cannot be calculated.

TODO

See Also
Msf.Frame
bool SimulateBurn
getset

Indicates whether to perform simulation instead of real burning.

Gets/Sets CD write method.

Event Documentation

EventHandler<AudioCDContinueEventArgs> OnContinueRead

Raised to check if reading should continue.

See Also
AudioCDContinueEventArgs
EventHandler<AudioCDContinueEventArgs> OnContinueWrite

Raised to check if burning should continue.

See Also
AudioCDContinueEventArgs
EventHandler<AudioCDProgressEventArgs> OnReadProgress

Raised to report the number of CDDA blocks read from the CD.

The event handler receives an argument of type AudioCDProgressEventArgs containing data related to this event.

This event is called for every chunk read from the CD. This may be as frequently as 10 times per second. A minimal processing is recommended, otherwise the whole audio reading operation may slow significantly.

See Also
AudioCDProgressEventArgs
EventHandler<AudioCDStatusEventArgs> OnReadStatus

Raised to report the reading status.

The event handler receives an argument of type AudioCDStatusEventArgs containing data related to this event.

See Also
AudioCDStatusEventArgs
EventHandler<AudioCDProgressEventArgs> OnWriteProgress

Raised to report the number of CDDA blocks written to the CD.

The event handler receives an argument of type AudioCDProgressEventArgs containing data related to this event.

See Also
AudioCDProgressEventArgs
EventHandler<AudioCDStatusEventArgs> OnWriteStatus

Raised to report the burning status.

The event handler receives an argument of type AudioCDStatusEventArgs containing data related to this event.

See Also
AudioCDStatusEventArgs
EventHandler<AudioCDTrackStatusEventArgs> OnWriteTrack

Raised to report the burning progress for individual tracks.

The event handler receives an argument of type AudioCDTrackStatusEventArgs containing data related to this event.

See Also
AudioCDTrackStatusEventArgs