tplay.m: artefact-free audio presentation despite Windows 7

バージョン 1.2.0.0 (5.4 KB) 作成者: Trevor Agus
Like 'sound' or 'wavplay', but uses ASIO for glitch-free sound presentation.
ダウンロード: 374
更新 2012/7/5

ライセンスの表示

Reliable audio presentation is difficult with the Matlab/Windows 7 combination. So tplay is a simple function (equivalent to sound or wavplay) that takes care of it.

***tplay will only work with ASIO-enabled sound-cards, i.e., it will probably NOT work on your laptop (unless you install ASIO4ALL -- see http://www.asio4all.com/)***

THE PROBLEM:
Several soundcard manufacturers recommend that Windows 7 users only use ASIO to communicate with the soundcard; Matlab's native audio functions (sound, wavplay, audioplayer) do not currently support ASIO.

As such sound/wavplay/audioplayer may work with Windows 7, but they are unsupported. Artefacts are in fact likely, including:
* Truncation (the last ~30 ms of your signal is removed, without any smooth ramp off, leading to an audible click)
* Glitches (click-like artefacts occurring in the middle of a sound at random intervals).

THE SOLUTION(S)
Download tplay (from here) and playrec.dll (from www.earcatching.com/playrec.zip for 32-bit computers)

You can then just replace your "sound(wave,fs)" with "tplay(wave,fs)" in your code.

OR, even better, adapt the code of tplay for your own purposes: it is just an interface to "playrec", which is a little more complicated, but a lot more powerful -- see http://www.playrec.co.uk/

SMALLPRINT
tplay.m has two undesirable features:

1/ tplay.m opens the first ASIO channel it finds, which should be the same channel on the same device each time. If you want more control, you can use the 'asioname' parameter, but you might be better using playrec directly.

2/ The first time it's used, tplay.m opens a new ASIO channel (if necessary) but then leaves it open for the next time! (The alternative, closing the ASIO channel immediately at the end of the sound, truncates up to 30 ms of the sound on some systems.) Make sure to exit Skype to avoid interactions!

To close the ASIO channel without a click, use 'tplayclean.m'.

To close the ASIO channel more violently, perhaps to stop an interminable sound, use 'tplayinterrupt.m'

You may find 'tplaywait.m' useful to wait until the end of a sound if you've used tplay's non-blocking mode (waitflag=false)

引用

Trevor Agus (2024). tplay.m: artefact-free audio presentation despite Windows 7 (https://www.mathworks.com/matlabcentral/fileexchange/35111-tplay-m-artefact-free-audio-presentation-despite-windows-7), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2007b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersAudio and Video Data についてさらに検索
タグ タグを追加
謝辞

ヒントを得たファイル: pa-wavplay

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.2.0.0

Links to playrec.zip rather than playrec.dll

1.0.0.0