adrielcafe / AndroidAudioConverter

Convert audio files inside your Android app easily. Supported formats: AAC, MP3, M4A, WMA, WAV and FLAC.
1.33k stars 254 forks source link

Problem with conversion: nothing happens #40

Open rnehrbossc opened 4 years ago

rnehrbossc commented 4 years ago

Hi there,

I have implemented this project with Android and for some reason it does not seem to be working. It says conversion starting, but doesn't ever do anything past this.

I am using the following code:

IConvertCallback myCallback = new IConvertCallback() {

            @Override
            public void onSuccess(File convertedFile) {
                Toast.makeText(MainActivity.this, "SUCCESS: " + convertedFile.getPath(), Toast.LENGTH_LONG).show();
            }

            @Override
            public void onFailure(Exception error) {
                Toast.makeText(MainActivity.this, "ERROR: " + error.getMessage(), Toast.LENGTH_LONG).show();
            }
        };
        Toast.makeText(this, "Converting audio file...", Toast.LENGTH_SHORT).show();
        AndroidAudioConverter.with(this).setFile(source).setFormat(AudioFormat.MP3).setCallback(myCallback).convert();

The callback does not trigger for success. When I artificially set the encoder to access something that is not there it will trigger and print "ERROR." But when I set it to something that I know is there, nothing happens. It does not successfully convert (I am checking with the file explorer) and does not print any further messages. Any idea what is causing this?