Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8477775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:33:29+00:00 2026-06-10T18:33:29+00:00

I am trying to record audio on the Device using AVAudioRecorder. That file is

  • 0

I am trying to record audio on the Device using AVAudioRecorder. That file is transmitted to a web server and I want to play that resulting file in a web browser..

I have tried various combinations of settings on the device…nothing seems to encode the file into the correct AAC format.

QuickTime says that it doesn’t know how to play this file.

Sample code

    private void InitializeRecordingSession() {
         string fileName = string.Format("{0}.m4a", Guid.NewGuid());
         string tmpdir = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/audio";
          if (!Directory.Exists(tmpdir))
               Directory.CreateDirectory(tmpdir);
          audioFilePath = Path.Combine(tmpdir, fileName);

          Console.WriteLine("Audio File Path: " + audioFilePath);

          var url = NSUrl.FromFilename(audioFilePath);
          var settings = new AVAudioRecorderSettings() {
               AudioFormat = AudioFormatType.MPEG4AAC,
               SampleRate = 44100,
               NumberChannels = 1,
               AudioQuality = AVAudioQuality.High,    
          };

          recorder = AVAudioRecorder.ToUrl(url, settings, out error);

          //Set Recorder to Prepare To Record
          recorder.PrepareToRecord();  
     }

Edit-By putting this code in before the line

recorder = AVAudioRecorder.ToUrl(url, settings, out error);

Everything worked.

NSError error;    
AVAudioSession audioSession = AVAudioSession.SharedInstance();
audioSession.SetCategory(AVAudioSession.CategoryRecord, out error);
audioSession.SetActive(true, out error);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T18:33:31+00:00Added an answer on June 10, 2026 at 6:33 pm

    The iOS SDK is apparently stupid. Setting the format ID key to kAudioFormatMPEG4AAC is not enough for it to actually encode the file; in QuickTime it will play but in its properties you’ll just see AAC and no further details. Changing the output file extension to m4a should help do the trick and make it apply the right encoding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Simply stated: I'm trying to record audio in a browser, and get that data
I'm trying to save an audio file on my server. I record the audio
We're trying to record video to a Flash Media Server using a NetConnection object
I'm trying to record sound using Android Emulator. I know that this question is
i've been trying to record and play recorded audio in android . I've used
I am trying to create an MP3 audio file on the device (iPhone). I
I am trying to record audio using an iPhone app and send the audio
I am trying to record audio in C# using NAudio. After looking at the
I am trying to record audio by MediaRecorder, and I get an error, I
I'm trying to record audio this.recorder = new android.media.MediaRecorder(); this.recorder.setAudioSource(android.media.MediaRecorder.AudioSource.MIC); this.recorder.setOutputFormat(android.media.MediaRecorder.OutputFormat.DEFAULT); this.recorder.setAudioEncoder(android.media.MediaRecorder.AudioEncoder.DEFAULT); this.recorder.setOutputFile(pruebaAudioRecorder.mp4); **this.recorder.prepare();**

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.