Why do I get errors when I replaced calls to signalblks​.Multimedi​aFileReade​r and/or signalblks​.Multimedi​aFileWrite​r with calls to dsp.AudioFileReader and dsp.AudioFileWriter respectively in Signal Processing Blockset 7.1 (R2010b) ?

2 views (last 30 days)
I have code that uses signalblks.MultimediaFileReader and/or signalblks.MultimediaFileWriter System Objects which works fine in R2010a. When I upgraded to R2010b, I received warnings that the name has been changed. However, when I replaced calls to signalblks.MultimediaFileReader and/or signalblks.MultimediaFileWriter with calls to dsp.AudioFileReader and dsp.AudioFileWriter respectively, I received some cryptic error messages.
For example, when I executed the following code:
h = dsp.AudioFileReader;
close(h)
I received the following error message:
??? Error using ==> horzcat
System objects do not support concatenation.
Error in ==> close at 67
h = [h cur_arg]; %#ok

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 19 Oct 2010
In Signal Processing Blockset 7.1 (R2010b), signalblks.MultimediaFileReader and signalblks.MultimediaFileWriter System Objects were renamed to dsp.AudioFileReader and dsp.AudioFileWriter respectively. With the rename, users who use the old System Object name are warned/ advised to switch to the new names. But the new System Objects also have some methods removed and some properties renamed. This might cause errors if the old methods/ properties are used in the code. The list of changes are given below.
1. The "close" method was renamed to "release". Using the close method on new classes will throw an error.
2. The "Audio" string in property names AudioSampleRate, SamplesPerAudioFrame and AudioOutputDataType in signalblks.MultimediaFileReader were removed in dsp.AudioFileReader (i.e. new property name is SampleRate).
3. The "AudioCompressor" property was renamed to "Compressor".
4. The VideoInputPort and VideoCompressor properties were removed in dsp.AudioFileWriter.
5. dsp.AudioFileReader and dsp.AudioFileWriter can no longer be used with video files (this was allowed using the old System Object when Video and Image Processing Blockset was installed).
To resolve the errors when using the new System Objects, the code needs to be updated to use the new property names.

More Answers (0)

Categories

Find more on Get Started with DSP System Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!