File: PsychPortAudio.m

package info (click to toggle)
psychtoolbox-3 3.0.19.14.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 86,796 kB
  • sloc: ansic: 176,245; cpp: 20,103; objc: 5,393; sh: 2,753; python: 1,397; php: 384; makefile: 193; java: 113
file content (79 lines) | stat: -rw-r--r-- 3,477 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
function varargout = PsychPortAudio(varargin)
% PsychPortAudio - High precision sound driver for Psychtoolbox-3.
%
% PsychPortAudio is a special sound driver for PTB-3. It is a replacement
% for all other sound drivers and PTB's old SND() function.
%
% PsychPortAudio provides the following features:
%
% - Allows instant start of sound playback with a very low onset latency
%   compared to other sound drivers (on well working hardware).
%
% - Allows start of playback at a scheduled future system time: E.g.,
%   schedule sound onset for a specific time in the future (e.g., visual
%   stimulus onset time), then do other things in your Matlab code.
%   Scheduled start of playback can be accurate to the sub-millisecond level
%   on some system setups.
%
% - Wait for sound onset, or continue with execution of your code
%   immediately.
%
% - Asynchronous operation: Sound playback works in the background while
%   your code continues to do other things.
%
% - Infinitely repeating playback, or playback of a sound for 'n' times.
%
% - Definition of complex audio schedules - "playlists" with high timing precision
%   control of which sounds start and stop and switch when.
%
% - Advanced audio mixing capabilities.
%
% - Returns timestamps and status for all crucial events.
%
% - Support multi-channel devices, e.g., 8-channel sound cards.
%
% - Supports multi-channel sound capture and full-duplex capture
%   and playback of sound on some systems.
%
% - Enumerate, open and use multiple sound cards in parallel.
%
% - Reliable (compared to Matlabs sound facilities).
%
% - Efficient, causes only very low cpu load.
%
% See the "help InitializePsychSound" for more info on low-latency
% configurations. See "help BasicSoundOutputDemo" for a very basic demo of
% sound output (without special emphasis on low-latency). See
% "BasicSoundInputDemo" for a basic demo of sound capture.
% "DelayedSoundFeedbackDemo" shows how to implement a simple audio feedback
% loop with controllable delay. There are also demos that show scheduling,
% modulation and mixing (cfe. BasicSoundScheduleDemo, BasicAMAndMixScheduleDemo,
% TurnTableDemo, BasicSoundPhaseShiftDemo).
% SimpleVoiceTriggerDemo shows how to record vocal reaction times.
% KeyboardLatencyTest uses audio to measure the response timing behaviour and
% timing accuracy of various human input devices, e.g., keyboard, mouse, touchpad,
% touchscreen, various response button boxes etc.
%
% PsychPortAudioTimingTest and PsychPortAudioDataPixxTimingTest are scripts
% that we use for testing PA's sound onset latency and accuracy. It also serves
% as an example on how to get perfectly synched audio-visual stimulus onsets.
%
% Type "PsychPortAudio" for an overview of supported subfunctions and
% "PsychPortAudio Subfunctionname?" for help on a specific subfunction.
%
% CAUTION: You *must* call InitializePsychSound before first invocation of
% PsychPortAudio()! If you omit that call, initialization of the driver may
% fail with some "Invalid MEX file" error!
%
%
% PsychPortAudio is built around a modified version of the free, open-source
% PortAudio sound library for portable realtime sound: http://www.portaudio.com

% History:
% 06/07/2007 Written (MK).
% 11/01/2008 Remove warning messages about "early beta release" (MK).
% 11/07/2018 Help text updates for the year 2018.
% 16/01/2022 Help text updates for the year 2022.

% Some check for not yet supported operating systems:
AssertMex('PsychPortAudio.m');