PrimoBurner for .NET  5.0
CD, DVD and Blu-ray Software Development Kit
Loading...
Searching...
No Matches
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.
 
CDSession CreateCDSession ()
 Creates a CDSession object from the current audio input list.
 
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).
 
bool ReadFromCD (int startLba, int blocks, AudioOutput output)
 Reads the specified audio region into a file/stream.
 
bool ReadFromCD (int trackNumber, AudioOutput output)
 Reads the specified audio track into a file/stream.
 
bool WriteToCD ()
 Writes the current track list to a CD.
 

Properties

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

Events

EventHandler< AudioCDContinueEventArgsOnContinueRead
 Raised to check if reading should continue.
 
EventHandler< AudioCDContinueEventArgsOnContinueWrite
 Raised to check if burning should continue.
 
EventHandler< AudioCDProgressEventArgsOnReadProgress
 Raised to report the number of CDDA blocks read from the CD.
 
EventHandler< AudioCDStatusEventArgsOnReadStatus
 Raised to report the reading status.
 
EventHandler< AudioCDProgressEventArgsOnWriteProgress
 Raised to report the number of CDDA blocks written to the CD.
 
EventHandler< AudioCDStatusEventArgsOnWriteStatus
 Raised to report the burning status.
 
EventHandler< AudioCDTrackStatusEventArgsOnWriteTrack
 Raised to report the burning progress for individual tracks.
 

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()

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

◆ CreateCDSession()

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

References AudioCD.CDSession.

◆ GetInputLength()

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.

◆ ReadFromCD() [1/2]

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.

◆ ReadFromCD() [2/2]

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.

◆ WriteToCD()

bool WriteToCD ( )

Writes the current track list to a CD.

Returns
true if sucessful; otherwise false

Property Documentation

◆ AudioInputs

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.

◆ CDSession

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).

Referenced by AudioCD.CreateCDSession().

◆ CDText

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.

◆ CloseDisc

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.

◆ Error

ErrorInfo Error
get

The error information for the last AudioCD operation.

See also
ErrorInfo

◆ ErrorInput

AudioInput ErrorInput
get

Gets the audio input that caused an error.

Use this property when last error is AudioCDError.InputError.

◆ SessionLength

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

Event Documentation

◆ OnContinueRead

EventHandler<AudioCDContinueEventArgs> OnContinueRead

Raised to check if reading should continue.

See also
AudioCDContinueEventArgs

◆ OnContinueWrite

EventHandler<AudioCDContinueEventArgs> OnContinueWrite

Raised to check if burning should continue.

See also
AudioCDContinueEventArgs

◆ OnReadProgress

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

◆ OnReadStatus

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

◆ OnWriteProgress

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

◆ OnWriteStatus

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

◆ OnWriteTrack

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