Main Content

Audio and Video

Read and write video and audio files; Record and play audio

Use audio and video functions to read and write video or audio files, and also record and play audio using your system's input and output devices.

  • Read or write video files by creating video objects. The video object contains information about the video file and enables you to read, analyze, and write video data.

  • Read or write audio data from files into arrays using the audio read and write functions.

  • Record or play audio files in with your system's input (microphone) and output devices (speakers) by using the audio recorder and player objects.

SeeSupported Video and Audio File Formats.

Functions

expand all

Read Video Data

录像师 读视频文件创建对象
read Read one or more video frames
readFrame Read next video frame
哈斯弗雷姆 Determine if video frame is available to read
getFileFormats File formats that录像师supports
mmfileinfo Information about multimedia file

Write Video Data

VideoWriter Create object to write video files
open Open file for writing video data
writeVideo Write video data to file
close Close file after writing video data
getProfiles Profiles and file formats thatVideoWritersupports
audioread Read audio file
audiowrite Write audio file
lin2mu Convert linear audio signal to mu-law
mu2lin Convert mu-law audio signal to linear
audioinfo Information about audio file

Play Audio

audioplayer Object for playing audio
isplaying Determine if playback is in progress
pause 暂停播放或录音
play Play audio fromaudioplayerobject
playblocking Play audio fromaudioplayerobject, hold control until playback completes
resume Resume playback or recording from paused state
stop 停止播放或录制

Record Audio

audiorecorder Object for recording audio
getaudiodata Store recorded audio signal in numeric array
getplayer Creates associatedaudioplayerobject
isrecording Determine if recording is in progress
record Record audio toaudiorecorderobject
recordblocking Record audio toaudiorecorderobject, hold control until recording completes

Play Sound

audiodevinfo Information about audio device
audiodevreset Refresh list of available audio devices
sound Convert matrix of signal data to sound
soundsc Scale data and play as sound
哔哔的声音 Produce operating system beep sound

Topics