(Not recommended) Add audio output channel to session
creates and displays the object
ch = addAudioOutputChannel(
ch representing a channel added
to the session
s using the device represented by
deviceName, with the specified
The channel is stored in the variable
Create a session and add an audio output channel to it.
s = daq.createSession ('directsound'); ch = addAudioOutputChannel(s,'Audio1',1);
Add several audio output channels to a session, and assign the index array.
Add two audio output channels to a session and assign output arguments to represent the channel objects and their indices.
s = daq.createSession ('directsound'); [ch,idx] = addAudioOutputChannel(s,'Audio3',1:2);
s— Data acquisition session
Data acquisition session specified as a session object created using
daq.createSession. Use the data
acquisition session for acquisition and generation operations. Create one
session per vendor and use that vendor session to perform all data
deviceName— Device ID
Device ID as defined by the device vendor, specified as a character vector
or string. Obtain the device ID by calling
daq.getDevices. The channel
specified for this device is created for the session object.
channelID— Channel ID
Channel ID, or the physical location of the channel on the device, added
to the session, specified as a numeric value. Supported values are specific
to the vendor and device. You can also add a range of channels. The index
for this channel displayed in the session indicates this channel's position
in the session. If you add a channel with channel ID
the first channel in a session, the session index is
ch— Audio output channel
Audio output channel that you add, returned as a channel object containing vendor specific channel information. Use this channel object to access device and channel properties. The channel object has the following properties.
|BitsPerSample||Display bits per sample|
|Device||Channel device information|
|ID||ID of channel in session|
|MeasurementType||Channel measurement type|
|Name||Specify descriptive name for the channel|
|Range||Specify channel measurement range|
|StandardSampleRates||Display standard rates of sampling|
|UseStandardSampleRates||Configure session to use standard sample rates|
idx— Channel index
Channel index returned as a numeric value. Through the index you can
access the array of the session object's
sessionobject interface is not recommended
Not recommended starting in R2019b
Use of this function with a
session object is not recommended. To
access a data acquisition device, use a
with its functions and properties instead.
For more information about using the recommended functionality, see Transition Your Code from Session to DataAcquisition Interface.