Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could provide a template for using a third-party decoder, similar to the template for "my_board"? (AUD-4974) #1098

Open
vwwwvwww opened this issue Oct 26, 2023 · 2 comments
Labels
Type: New Feature New feature or request

Comments

@vwwwvwww
Copy link

vwwwvwww commented Oct 26, 2023

Is your feature request related to a problem? Please describe.

When using the default library, we do it like this:

              //   mp3_decoder_cfg_t mp3_cfg = DEFAULT_MP3_DECODER_CONFIG();
              //   audio_element_handle_t mp3_decoder = mp3_decoder_init(&mp3_cfg);
              //   esp_audio_codec_lib_add(player, AUDIO_CODEC_TYPE_DECODER, mp3_decoder);
              //  //    audio_pipeline_register(pipeline, mp3_decoder , "dec");

When I want to use a third-party decoder:

For example, how can I use the following code to decode a WAV file?

              uint32_t recvSize = 0;
              do
              {
                recvSize =  file.read((void*)buffer, 1024);
              
                for(uint32_t i = 0;i<recvSize/2;i++)
                {
                  partWavData[2*i] = buffer[i];   
                  partWavData[2*i+1] = buffer[i]; 
                }
              
                mi.Write((char*)partWavData, recvSize*2); //i2s_write
              
                  // startPos += recvSize;
                  // file.seek(startPos);
              }while(recvSize>0);
              file.close();

Could provide a template for using a third-party decoder, similar to the template for "my_board"?

@github-actions github-actions bot changed the title Could provide a template for using a third-party decoder, similar to the template for "my_board"? Could provide a template for using a third-party decoder, similar to the template for "my_board"? (AUD-4974) Oct 26, 2023
@jason-mao jason-mao added the Type: New Feature New feature or request label Oct 27, 2023
@jason-mao
Copy link
Collaborator

That's a good idea. I think we can provide an example like this.

@vwwwvwww
Copy link
Author

That's great! I hope to be able to use it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants