Download Playrec!

Playrec Source

Playrec is now hosted on GitHub: View the Playrec source on GitHub

Playrec Scripts

The Playrec examples are now hosted on GitHub: View the Playrec examples on GitHub To help to get started using Playrec, the examples provided demonstrate how to use the utility and provide some basic functionality that may be useful in other scenarios. Scripts included include:
test_playrec
Checks if playrec is available and then runs 3 output tests on a selected output device. The first test shows simple blocking output, the second uses simple non-blocking output and the third shows how continuous output can be achieved without needing to precalculate all samples.
select_play_device
Displays a textual list of all available output devices in the command window, and waits for user input to select. Only a valid device number can be selected.
select_rec_device
Displays a textual list of all available record devices in the command window, and waits for user input. Only a valid device number can be selected.
play_wav
Plays a mono or stereo wav file using Playrec. The samples are loaded from the file in sections, demonstrating how to create a continuous output without glitches.
play_ambi_wav
Plays a WAVEX Ambisonic Wav file using Playrec. The samples are loaded from the file and converted to the required output in sections, demonstrating how to create a continuous output without glitches. This utilises wavexread.m, a version of wavread modified by Sylvain Choisel to read wave-format-extensible files.
spectrum_analyser
Uses Playrec to show a realtime spectrum and waveform, and some of the possibilities that Playrec can be used for.
bformat_dec
Decodes a B-Format signal into speaker feeds, as used by play_ambi_wav.
bformat_enc
Encodes a mono signal into a B-Format signal at a specified azimuth and elevation.
bformat_rot_tilt_tumble
Rotates, tilts and tumbles a B-Format signal.
loop_back
Demonstrates simultaneous input and output by looping an input channel onto one or more outputs. By optimising parameters the latency can be reduced, depending on the target platform.
If you have any other scripts please send them to me.

mexopts.bat

Download Example mexopts.bat

When compiling on Windows the options Matlab uses are stored in mexopts.bat. In most cases after running mex -setup in Matlab this file should be correctly configured and not need to be changed. However in some cases it does need to be changed, including when Matlab cannot automatically detect the required compiler or the system configuration is unusual. Although the settings in this file need to be different for different compilers and versions of Matlab, this version of mexopts.bat tries to be as generic as possible for the Microsoft Visual C++ compilers. Due to limited access to different versions of Matlab, this has not been thoroughly tested and so is not guaranteed to work.

To use this file download it so that it is in the current directory within Matlab when the compiling occurs. In verbose mode the location of the options file being used will be displayed near the start of the output in the Command Window. Depending on the system and compiler the variables VCINSTALLDIR, MSSdk and LIBLOC may need to be changed. Possible examples are given in the file, although depending on the installation alternative paths may be required.

Even if the version of Matlab being used does not support a particular version of Microsoft Visual C++ compiler, by configuring the mexopts.bat file it may be possible to get the utility to compile.