GithubHelp home page GithubHelp logo

hangpuyan / audio-recording-playback-and-upload Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gingofthesouth/audio-recording-playback-and-upload

0.0 2.0 0.0 276 KB

Record audio on in iOS and upload it to a server running PHP. Uses NSURLSession, NSURLSessionUploadTask.

Objective-C 96.69% PHP 3.31%

audio-recording-playback-and-upload's Introduction

Audio-Recording-Playback-and-Upload

Record audio on in iOS and upload it to a server running PHP. Uses NSURLSession, NSURLSessionUploadTask.

This is example code to demonstrate two things:

  1. How to record and playback audio in an ios app.

  2. How to upload a file using NSURLSession / NSURLSessionUploadTask and save the file using PHP.

Use this code to figure out how to implement the features in your own project. I am not repsonsible for any issues arrising form using this code.

#Instructions: The code that records and uploads audio from the microphone is in ViewController.m.

To use this code:

  1. Download the iOS code and open in Xcode.

  2. Change the constant at the top of ViewController.m to reflect your server address: #define kDestinationURL @"https://yourURL.com/fileUpload.php"

  3. Place the fileUpload.php file in an accessible directory on your webserver.

  4. Edit the $file = 'uploads/recording.m4a'; line in the PHP to the file path you want to save the recording.

  5. Compile the iOS application.

  6. Press the record button. Choose allow if prompted for access to the microphone.

  7. When you have finished recording the audio, pless the stop button. You can then press play to hear the recording.

  8. Press the 'Send' button to upload the file to your server.

Now you can point your browser to the location you saved your file to listen to your recorded message.

audio-recording-playback-and-upload's People

Contributors

gingofthesouth avatar

Watchers

 avatar  avatar

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.