The first three articles have explained in detail how to convert the WAV audio format to the FLV format. This article describes how to convert the last part, first, the AMR is converted into WAV format, and then the WAV format is encapsulated
FLV format. The key part of this article is the part in the while loop. The o
Problem
You want to have a method for playing sound quickly. Solution
In xna3.0, you can directly load and play sounds from xNa without loading them using xact. Although this method removes some advanced xact functions, it makes playing sound very easy. Working Principle
First, add a sound file to the project. The method is the same as adding an image to the project. For more information, see tutorial 3-1. The simplest solution is to drag a .wav fi
Based on the analysis of the FLV format in the previous article, the FLV format includes file header and file body. Therefore, you can define file header and previous tag size #0 as follows:
Const static unsigned char flvfilehdr [] = {0x46, 0x4c, 0x56, 0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0x00};
The file body consists of the tag header and tag data. Therefore, the tag header can be defined as follows:
Unsigned char flvtaghdr [] = {0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0x00};
Note:
[] pbaacbuffer;}Int wavtoaac (const char * wavdata, int wavdatalen, char * aacdata ){/*** Convert WAV audio data of the length of wavdatalen into AAC and write aacdata* If AAC data is successfully returned, the value-1 is returned if an error occurs.*/If (hencoder = NULL ){Return-1;}Int32 ninputsamples = 0;Int32 readpcmbytesum = 0;Int32 writeaacbytesum = 0;Int32 naacencret = 0;Int32 J = 0;Int32 K = 0;While
C Language resolution WAV audio file code address: Github:github.com/casterwx/c-wave-master Directory
Objective
Understanding WAV Audio Files
What is a binary file
Binary format parsing of WAV
C language parsing WAV
WAV audio files
Chess Boy 1048272975
WAV is a file format for saving audio information that is widely used in Windows and its applications, and today the mainstream audio player supports the playback of WAV
Whether it is text, image or sound, must be organized and stored in a certain format, so that the player will know how to parse this piece of data, for example, for the original image data, our common format is YUV, Bitmap, and for audio, the simplest common format is the WAV format.WAV format, like bitmap, are Microsoft developed a file format specification, they all have a similarity, is the whole file is
Based on the analysis in the first three articles, you only need to write a MAKEFILE file to compile main. cpp and aaccodechelper. cpp, as shown below:
Makefile:
Cxx = g ++
Objects = Main. O aaccodechelper. oLibs =-L/usr/local/lib-lfaac-wl,-rpath,/usr/local/lib-I/usrWavtoaac: $ (objects)$ (Cxx) $ (objects)-O darling $ (libs)Aaccodechelper. O: aaccodechelper. cpp aaccodechelper. h typedef. h$ (Cxx)-C aaccodechelper. cpp $ (libs)Main. O: Main. cpp aaccodechelper. h$ (Cxx)-C main. cpp $ (libs)Cl
Applies to all PowerShell versions
In fact, playing WAV files in PowerShell is very simple:
Copy Code code as follows:
# Find an available WAV audio file in the Windows directory
$WAVPath = Get-childitem-path $env: windir-filter *.wav-recurse-erroraction silentlycontinue |
Select-object-first 1-expa
1. WAV Overview wav is A sound file format developed by Microsoft Corporation (Microsoft) that complies with the riff (Resource Interchange File format) files specification, The audio information resource for saving the Windows platform is widely supported by the Windows platform and its applications, which also supports a variety of compression operations, such
Find the uda1341 driver on the internet, compile it into the uda1341.ko module, and open the Kernel configuration menu.Device Drivers --->Sound --->Make modules generates the soundcore. Ko module. Load the two modules to play the audio.
After carefully reading the uda1341 driver, we found that only 16 bits of audio can be played.Convert to dual-channel when copying to the driver. Therefore, we recommend tha
Android audio and video goes deep into an AudioRecord recording to generate pcm into wav (with source code download), androidaudiorecord
This project address is named AudioRecord recording (can be paused, convert pch to wav ).Https://github.com/979451341/Audio-and-video-learning-materialsHere is an official description
This paper consists of three parts, the first part of the background-audio type and the motive of this article, the second classification than MATLAB under the Wavread () function, the third part gives the C + + implementation of the function. A Background introduction1.1 Motive of this article1) All WAV audio processing is based on the
This project address, name is Audiorecord recording (can pause, convert PCH to WAV), for starHttps://github.com/979451341/Audio-and-video-learning-materialsFirst, the official description.1.AndioRecord Approximate descriptionThe main function of the Andiorecord class is to enable various Java applications to manage audio resources so that they can record sound co
// Mmsystem play audio in WAV format// Mmsystem supports *. wav sound format snd-> soundrecorderUsesMmsystem; // reference mmsystem// Play the system sound{. Default // This is a string ('str ').MailbeepSystemexclamationSystemexitSystemhand}Playsound ('systemeg', 0, snd_async); // A pchar string// Play the sound in the list boxPlaysound (pchar (listbox1.items [li
This design idea: first open a normal WAV audio file, from the 44 bytes in front of the defined file header, remove the file header definition message, placed in a file header structure. Then open the ALSA audio driver, from the file header structure to remove the sampling accuracy, the number of channels, sampling frequency three important parameters, using the
Because you only need to execute it on Windows, first think about using the MCI interface. After a try, mcisendcommand can be used to play the basic WAV file. However, loop playback of Wav is troublesome. The message mm_mcinotify must be sent to the window.
After Google, we found that there was a simpler method-UseSndplaysound. One statement, sndplaysound (filename, snd_async | snd_loop), can play
project.
Now we have a new empty project. In the tree directory on the left, find wave banks, which contains waves, which is the audio file. Right-click wave banks and select new wave bank. Then, right-click sound banks and select new sound bank to create a new sound bank. Sound bank contains sound, which are the objects actually played in the xNa project. A sound points to a wave, and some effects can be added to the wave.
Now there should be two
WAV is a lossless sound file under Windows, the file holds the audio PCM information and the player plays that music when most information is made, he has two blocks, the first block is the format block, the second block is the data blockFirst, the format block, the format block with a picture can be explained, as followsUsing Winhex to analyze a WAV
(two-channel or mono). And your single sample of WAV is 8-bit or 16-bit. 3.2 Open FAAC Encoder, ready to encode before the call Faacencopen Open FAAC Encoder, a single input sample number ninputsamples and output data maximum bytes nmaxoutputbytes; Based on Ninputsamples and nmaxoutputbytes, the buffers are created for the WAV data and the AAC data to be obtained respectively, the call faacencgetcurrentcon
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.