Skip to content

new audio format #8

Closed
Closed

Description

@AnthonyKoueik

can this app support other formats, like mp3, AAC ... ?

Activity

  1. adrielcafe commented on Sep 15, 2016

    @adrielcafe
    Owner

    Hi @AnthonyKoueik,

    You're lucky! I've made a lib for that yesterday. Please check AndroidAudioConverter.

    After the recording finish, you can convert WAV to AAC, MP3, M4A, WMA and FLAC:

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == 0) {
            if (resultCode == RESULT_OK) {
                // Great! User has recorded and saved the audio file
                // Now you can convert it
                AndroidAudioConverter.with(MyActivity.this)
                    .setFile(myWavFile) 
                    .setFormat(AndroidAudioConverter.AudioFormat.MP3)
                    .setCallback(callback)
                    .convert();
            } else if (resultCode == RESULT_CANCELED) {
                // Oops! User has canceled the recording
            }
        }
    }

    Please let me know if this solve your problem.

  2. AnthonyKoueik commented on Sep 15, 2016

    @AnthonyKoueik
    Author

    that's amazing, but i want to ask if this affect the size?
    like aac format files a usually small and fine quality.
    anyway i will try it out now.
    awesome work

  3. adrielcafe commented on Sep 15, 2016

    @adrielcafe
    Owner

    Yes, the size reduce a lot with AAC, MP3, M4A and WMA formats.
    I've made a quick test: an WAV file with 10s has ~500KB, while any format above has less than 60KB.

    ⚠️ Because I've made AndroidAudioConverter with FFmpeg lib my lib has ~20MB 😞 . I'm looking for alternatives to reduce the lib size.

  4. AnthonyKoueik commented on Sep 15, 2016

    @AnthonyKoueik
    Author

    I didn't read your Audio Recorder code, can't I change it to aac output ?

  5. adrielcafe commented on Sep 15, 2016

    @adrielcafe
    Owner

    I'm using OmRecorder lib to record audio. Currently it does't support other formats.

  6. 1sMcGrady commented on Oct 13, 2016

    @1sMcGrady

    i'm stucked with a "FFmpeg not loaded" Exception , can you help me with this? thx ~

  7. MarsDiplomatToEarth commented on Mar 14, 2020

    @MarsDiplomatToEarth

    how can i get the time of my audio file

  8. Mathias8405 commented on Mar 21, 2022

    @Mathias8405

    The library loads just fine for me, but I can not get it to convert files. All converts failed. I am not sure if it's because of the new scoped storage method for apps with api 29 and up or what the issue is. ActivityForResult is depreciated, and with the new method it still doesn't work. Hey Adrielcafe, will you please give us an update that works with Android 12 api 32, and the new ActivityForResult launcher method, and with the new scoped storage. Thanks!

  9. Mathias8405 commented on Mar 21, 2022

    @Mathias8405

    If anyone wants to try and fix the project that I started and see if you can get this to work go ahead. Download it here https://file.io/ds6UHOxV4yns

    If you get it to work please send the fixed project to my email rockdrummer84@gmail.com Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions