Coder Social home page Coder Social logo

microsoft / audio-recorder Goto Github PK

View Code? Open in Web Editor NEW
46.0 73.0 30.0 2.6 MB

Audio Recorder is an example application demonstrating how to record and play audio in Windows Phone 8 devices. XNA Audio API and Windows Audio Session API (WASAPI) are covered by the example.

License: Other

C# 82.67% C++ 17.23% Objective-C 0.10%

audio-recorder's Introduction

AudioRecorder

AudioRecorder example application demonstrates how to record and play audio on Windows Phone 8 devices. XNA Framework Audio API and Windows Audio Session API (WASAPI) are covered by the application.

Main pageย  Audio files page

This example application is hosted in GitHub: https://github.com/Microsoft/audio-recorder

Developed with:

  • Microsoft Visual Studio Express for Windows Phone 2012.

Compatible with:

  • Windows Phone 8

Tested to work on:

  • Nokia Lumia 920
  • Nokia Lumia 925
  • Nokia Lumia 1520

Instructions

Make sure you have the following installed:

  • Windows 8
  • Windows Phone SDK 8.0

To build and run the sample:

  • Open the SLN file
    • File > Open Project, select the file AudioRecorder.sln
  • Select the target, for example 'Emulator WXGA'.
  • Press F5 to build the project and run it on the Windows Phone Emulator.

To deploy the sample on Windows Phone device:

About the implementation

Important folders:

Folder Description
/ Contains the project file, the license information and this file (README.md)
AudioRecorder Root folder for the implementation files.
AudioRecorder/Assets Graphic assets like icons and tiles.
AudioRecorder/Properties Application property files.
AudioRecorder/Resources Application resources.
WasapiAudioComp Root folder of Windows Phone Runtime component for WASAPI implementation files.

Important classes:

File Description
MainPage This class is the main UI of the app.
AudioManager Handles all the UI related audio actions.
XnaAudio Handles the recording and playback of audio using XNA Audio API.
WasapiAudio Handles the audio capturing and rendering using WASAPI.

For more information about audio handling in Windows Phone 8 devices, see an article available at http://developer.nokia.com/Community/Wiki/Audio_recording_and_playback_options_in_Windows_Phone.

Known issues

No known issues.

License

See the license file delivered with this project. The license is also available online at https://github.com/Microsoft/audio-recorder/blob/master/License.txt

Version history

  • 0.3.0.0 Added 720p resolution support and yet another missing dependency fix.
  • 0.2.0.0 Added a missing dependency affecting others than ARM device builds.
  • 0.1.0.0 First beta release.

audio-recorder's People

Contributors

mikpiipp avatar tompaana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

audio-recorder's Issues

Save icon shown instead of stop

In the files page, the save icon is shown instead of the stop icon. In addition, the save capability does not seem to exist (and I can't find the files in the "Files" file manager by Microsoft).

recorded audio with AAC format using window phone

Hi pro
Could anyone give me a hint on compression of recorded audio with AAC format using window phone 8.0?
The required spec is below

Bitrate: 16kbps
Sampling rate: 11025Hz
Channels: mono

The user need the small size to transfer over cloud service. The size recorded audio for 10s must be around 18kb

Thank you.

AccessViolationException

  1. Open Recorder
  2. Tap on Quality to change to Stereo
  3. Press the Record button and record some audio.
  4. Tap on the File button to access the file you recorded.
  5. Play the file.
  6. Click Back to return to Recorder.
  7. Click Record.

Application crashes - System.AccessViolationException in AudioRecorder.DLL ...
Attempted to read or write protected memory. ...

WasapiAudio::Update() will skip audio samples smaller than Render buffer

Currently, the Update() method will not play a sound sample if the sample sound is smaller than the audio buffer given by the Render device. The check:

if (audioIndex + (long)numFramesAvailable * m_sourceFrameSizeInBytes < audioByteCount)

will essentially skip such samples. Since I use the WASAPI code for small sound effects, I needed to fix this. The following code is what I use:

    if (SUCCEEDED(hr))
    {
        // Grab all the available space in the shared buffer.
        hr = m_pRenderClient->GetBuffer(numFramesAvailable, &pData);
    }

    // NEW CODE STARTS HERE 

    if (SUCCEEDED(hr))
    {

        UINT32 numFramesInData = (audioByteCount - audioIndex) / m_sourceFrameSizeInBytes;
        if (numFramesInData > numFramesAvailable)  // We do not have so many frames in audio buffer
        {
            numFramesInData = numFramesAvailable;
        }

        memcpy(pData, audioBytes + audioIndex, numFramesInData * m_sourceFrameSizeInBytes);
        audioIndex += numFramesInData * m_sourceFrameSizeInBytes;
        hr = m_pRenderClient->ReleaseBuffer(numFramesInData, 0);

    }

    // NEW CODE ENDS HERE 

    if (SUCCEEDED(hr))
    {
        hr = m_pDefaultRenderDevice->GetCurrentPadding(&numFramesPadding);
    }

Audio samples smaller than the frame size are essentially skipped. If you find the code useful and correct, you can use it :-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.