WaveIO Speaker: Paul Date:2013.08.07 1. Outline Wave File Format Multi-Media API (Output) Damo Multi-Media API (Input) Damo Reference 2.

Slides:



Advertisements
Similar presentations
Reading and Writing Text Files Svetlin Nakov Telerik Corporation
Advertisements

Audio 2 Subject:T0934 / Multimedia Programming Foundation Session:9 Tahun:2009 Versi:1/0.
1 Audio input and output Speaker: Ching Chen Chang Date:
File Organizations Sept. 2012Yangjun Chen ACS-3902/31 Outline: File Organization Hardware Description of Disk Devices Buffering of Blocks File Records.
CSCI 3280 Tutorial 3 Project (C++)
EXCEPTIONS Def: An exception is a run-time error. Examples include: attempting to divide by zero, or manipulate invalid data.
Web siteWeb site ExamplesExamples 1 Mode of Operation Protected mode  4 GB  32-bit address  Windows, Linux Real-address mode  1 MB space  20-bit address.
Java Audio.
Ceng 351 Lab1 Introduction to File Structures. Input Output Functions in C In C there is not any predefined commands for data transfer. – C functions.
Project 1 Speech Detection Due: Sunday, February 1 st, 11:59pm.
Introduction To XAudio2 © Allan C. Milne Abertay University v
Speech Detection Project 1. Outline Motivation Problem Statement Details Hints.
Windows audio architecture Win MM Application DirectSound Application SysAudio.SYS Kmixer.SYS WinMM.DLLDSound.DLL Device Drive Container USB Device Driver.
EEC-492/592 Kinect Application Development
2011 Embedded Systems Software Training Center BluRapport SDK.
University of Calgary – CPSC 441. C PROGRAM  Collection of functions  One function “main()” is called by the operating system as the starting function.
How to Add WMI Interfaces to SCSIPort and Storport Miniports
ACE Address Configuration Executive. Why ACE? ACE provides access to several address resolution protocols under a single API ACE is the only API available.
CP104 Introduction to Programming File I/O Lecture 33 __ 1 File Input/Output Text file and binary files File Input/output File input / output functions.
TWAIN Open industry standard interface for the input devices to capture multimedia objects More and more sophisticated devies are developed to cater to.
Douglas Boling President Boling Consulting Inc. SESSION CODE: WEM304.
1 Programs Composed of Several Functions Syntax Templates Legal C++ Identifiers Assigning Values to Variables Declaring Named Constants String Concatenation.
CSE3AGT Paul Taylor Stupid Conventions! l = Long p = Pointer h = handle g = global wnd = Windows WM = Windows Message d3d = Direct3D hr = HRESULT.
Introduction to Biometrics Dr. Bhavani Thuraisingham The University of Texas at Dallas Lecture #23 Biometrics Standards - II November 14, 2005.
File Handling In C By - AJAY SHARMA. We will learn about- FFile/Stream TText vs Binary Files FFILE Structure DDisk I/O function OOperations.
Advanced File Operations Chapter File Operations File: a set of data stored on a computer, often on a disk drive Programs can read from, write to.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 12: Advanced File Operations.
Multimedia File Format Heejune AHN Embedded Communications Laboratory Seoul National Univ. of Technology Fall 2011 Last updated
2015/11/141 Audio I/O Speaker : Wei-Shin Pan DATE :
Speech Processing and Recognition © Florida Institute of Technology Access audio data in real time and apply to speech recognition Final Exam Project By.
Chapter 13 DirectSound 로 잡음 만들기. 2 History of Sound Programming Sound programming always gets put off until the end DOS –Third party sound libraries:
Sound DirectMusic & DirectSound. Sound Formats Wav Midi (Musical Instrument Digital Interface) DLS (Downloadable Sounds) DirectMusic Producer Segments.
1 Simple Input/Output  C++ offers the iostream library, which defines a system of character-oriented Input/Output (I/O) using object oriented programming.
Writing and Reading Files Methods for processing disk files File Control Blocks (FCBs) –Supported by DOS –Can address drives and filenames.
Introduction to Systems Programming (CS 0449) C Preprocessing Makefile File I/O.
1 Audio input and output Speaker: Ching Chen Chang Date:
READING AND WRITING FILES. READING AND WRITING FILES SEQUENTIALLY  Two ways to read and write files  Sequentially and RA (Random Access  Sequential.
Basic I/O in C Computer Organization I 1 August 2009 © McQuain, Feng & Ribbens Stream Model of I/O header file: A stream provides a connection.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Chapter -7 Basic function of Input/output system basics and file processing Stream classes : I/O Streams. A stream is a source or destination for collection.
The SPIM Trap Handler Syscall Trap handler services String operations File operations Memory allocation Central Connecticut State University, MIPS Tutorial.
1 CSC103: Introduction to Computer and Programming Lecture No 28.
Files A collection of related data treated as a unit. Two types Text
FILES IN C. File Operations  Creation of a new file  Opening an existing file  Reading from a file  Writing to a file  Moving to a specific location.
C Programming Day 2. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/LA07/003 Version No. 1.0 Union –mechanism to create user defined data types.
File Operations. FILE PROCESSING For the purposes of the following discussion, reading means copying all or part of an existing file into memory Writing.
Ms N Nashandi Dr SH Nggada 2016/01/03Ms N Nashandi and Dr SH Nggada1 Week 6 -File input and output in C++
Real Numbers Device driver process within the operating system that interacts with I/O controller logical record 1 logical record 2 logical record 3.
Silberschatz and Galvin  C Programming Language Kingdom of Saudi Arabia Ministry of Higher Education Al-Majma’ah University College of Education.
File I/O. I/O Flags Flags are passed to give some information about how the file is to be used. – Read only file – flag=0x0 – Write only file – flag=0x1.
Keerthi Nelaturu Url: site.uottawa.ca/~knela006
Yongchang, Kai, Justin, Rama
Chapter 7 Text Input/Output Objectives
Chapter 7 Text Input/Output Objectives
EEC-693/793 Applied Computer Vision with Depth Cameras
Chapter 22 – part a Stream refer to any source of input or any destination for output. Many small programs, obtain all their input from one stream usually.
Chapter 7 Text Input/Output Objectives
File I/O.
EEC-693/793 Applied Computer Vision with Depth Cameras
CSC215 Lecture Input and Output.
Beginning C Lecture 11 Lecturer: Dr. Zhao Qinpei
EEC-693/793 Applied Computer Vision with Depth Cameras
File Input and Output.
Topics Input and Output Streams More Detailed Error Testing
A Simple Two-Pass Assembler
System Programming by Leland L. Beck Chapter 2
Console A presentation by Inti Vincenzo Pizzoni.
C Preprocessing File I/O
File Handling in C.
Professor Jodi Neely-Ritz University of Florida
Presentation transcript:

WaveIO Speaker: Paul Date:

Outline Wave File Format Multi-Media API (Output) Damo Multi-Media API (Input) Damo Reference 2

Wave File Format 3

WAVEFORMATEX typedef struct { WORD wFormatTag; WORD nChannels; DWORD nSamplesPerSec; DWORD nAvgBytesPerSec; WORD nBlockAlign; WORD wBitsPerSample; WORD cbSize; } WAVEFORMATEX; This structure defines the format of waveform-audio data. 4

WAVEHDR typedef struct { LPSTR lpData; DWORD dwBufferLength; DWORD dwBytesRecorded; DWORD dwUser; DWORD dwFlags; DWORD dwLoops; struct wavehdr_tag* lpNext; DWORD reserved; } WAVEHDR; This structure defines the header used to identify a waveform-audio buffer. 5

MMCKINFO typedef struct { FOURCC ckid; DWORD cksize; FOURCC fccType; DWORD dwDataOffset; DWORD dwFlags; } MMCKINFO; The structure contains information about a chunk in a RIFF file. 6

mmioOpen() HMMIO mmioOpen( LPSTR Filename, MMIOINFO mmioinfo, DWORD dwOpenFlags ); The mmioOpen function opens a file for unbuffered or buffered I/O. Returns a handle of the opened file. If the file cannot be opened, the return value is NULL. dwOpenFlags :MMIO_CREATE 、 MMIO_WRITE 、 MMIO_READ …etc. 7

mmioCreateChunk() MMRESULT mmioCreateChunk( HMMIO hmmio, MMCKINFO &ck, UINT wFlags ); The mmioCreateChunk function creates a chunk in a RIFF file that was opened by using the mmioOpen function. wFlags :MMIO_CREATERIFF Returns MMSYSERR_NOERROR if successful 8

mmioFOURCC() FOURCC mmioFOURCC( CHAR ch0, CHAR ch1, CHAR ch2, CHAR ch3 ); The mmioFOURCC macro converts four characters into a four-character code. Returns the four-character code created from the given characters. 9

mmioWrite() LONG mmioWrite( HMMIO hmmio, char _huge* pch, LONG cch ); The mmioWrite function writes a specified number of bytes to a file opened by using the mmioOpen function Returns the number of bytes actually written. 10

mmioAscend() MMRESULT mmioAscend( HMMIO hmmio, MMCKINFO &ck, UINT wFlags ); The mmioAscend function ascends out of a chunk in a RIFF file wFlags : must be zero. Returns MMSYSERR_NOERROR if successful 11

mmioClose() MMRESULT mmioClose( HMMIO hmmio, UINT wFlags ); Returns zero if successful or an error otherwise. 12

waveOutOpen() MMRESULT waveOutOpen( HWAVEOUT &ohandle, UINT uDeviceID, WAVEFORMATEX &wf, DWORD dwCallback, DWORD dwInstance, DWORD fdwOpen ); Opens a specified waveform output device for playback. Returns MMSYSERR_NOERROR if successful. 13

waveOutPrepareHeader() MMRESULT waveOutPrepareHeader( HWAVEOUT ohandle, WAVEHDR &wh, UINT cbwh ); Prepares a waveform data block for playback. Returns MMSYSERR_NOERROR if successful. 14

waveOutWrite() MMRESULT waveOutWrite( HWAVEOUT ohandle, WAVEHDR &wh, UINT cbwh ); Sends a data block to the specified waveform output device. Returns MMSYSERR_NOERROR if successful. 15

waveOutReset() MMRESULT waveOutReset( HWAVEOUT ohandle ); Stops playback on a specified waveform output device and resets the current position to 0. Returns MMSYSERR_NOERROR if successful. 16

waveOutUnprepareHeader() MMRESULT waveOutUnprepareHeader( HWAVEOUT ohandle, WAVEHDR &wh, UINT cbwh ); Cleans up the preparation performed by waveOutPrepareHeader. Returns MMSYSERR_NOERROR if successful. 17

waveOutClose( ) MMRESULT waveOutClose( HWAVEOUT ohandle ); Closes the specified waveform output device. Returns MMSYSERR_NOERROR if successful. 18

waveInOpen() MMRESULT waveInOpen(HWAVEIN &ihandle, UINT DeviceID, WAVEFORMATEX &waveformat, DWORD dwCallback, DWORD dwInstance, DWORD fdwOpen ); Open a specified waveform input device for recording. uDeviceID : WAVE_MAPPER fdwOpen : CALLBACK_WINDOW,CALLBACK_THREAD Return MMSYSERR_NOERROR means success 19

waveInPrepareHeader() MMRESULT waveInPrepareHeader( HWAVEIN ihandle, WAVEHDR &wh, UINT cbwh ); Prepares a buffer for waveform input. Returns MMSYSERR_NOERROR if successful. 20

waveInAddBuffer() MMRESULT waveInAddBuffer( HWAVEIN ihandle, WAVEHDR &wh, UINT cbwh ); Sends an input buffer to the specified waveform-audio input device. Returns MMSYSERR_NOERROR if successful. 21

waveInStart() MMRESULT waveInStart( HWAVEIN ihandle ); Starts input on the specified waveform input device. Returns MMSYSERR_NOERROR if successful. 22

waveInReset() MMRESULT waveInReset( HWAVEIN ihandle ); Stops input on a specified waveform input device and resets the current position to 0. Returns MMSYSERR_NOERROR if successful. 23

waveInUnprepareHeader() MMRESULT waveInUnprepareHeader( HWAVEIN ihandle, WAVEHDR &wh, UINT cbwh ); Cleans up the preparation performed by waveInPrepareHeader. Returns MMSYSERR_NOERROR if successful. 24

waveInClose() MMRESULT waveInClose( HWAVEIN ihandle); Closes the specified waveform-audio input device. Returns MMSYSERR_NOERROR if successful. 25

Demo 26

Reference Wavefomat Multimedia FILE I/O Waveform Audio 27