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

Intent of accepting additional AudioFileName parameter for overloaded TranscribeAudio and TranslateAudio APIs which already accept an AudioStream input parameter #71

Open
cjkarande opened this issue Jun 18, 2024 · 3 comments
Labels
question Further information is requested

Comments

@cjkarande
Copy link

cjkarande commented Jun 18, 2024

Hello @trrwilson,

Is there a specific Intent of accepting additional AudioFileName parameter for overloaded TranscribeAudio and TranslateAudio APIs which already accept an AudioStream input parameter?

public virtual ClientResult TranscribeAudio(Stream audio, string audioFilename, AudioTranscriptionOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

public virtual async Task<ClientResult> TranslateAudio(Stream audio, string audioFilename, AudioTranslationOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

@cjkarande cjkarande changed the title Intent of accepting AudioFileName parameter for overloaded TranscribeAudio and TranslateAudio APIs which take AudioStream as an input parameter Intent of accepting additional AudioFileName parameter for overloaded TranscribeAudio and TranslateAudio APIs which already accept an AudioStream as an input parameter Jun 18, 2024
@cjkarande cjkarande changed the title Intent of accepting additional AudioFileName parameter for overloaded TranscribeAudio and TranslateAudio APIs which already accept an AudioStream as an input parameter Intent of accepting additional AudioFileName parameter for overloaded TranscribeAudio and TranslateAudio APIs which already accept an AudioStream input parameter Jun 18, 2024
@trrwilson trrwilson added the question Further information is requested label Jun 18, 2024
@trrwilson
Copy link
Collaborator

Hello, @cjkarande!

The transcription and translation APIs require this filename data as part of the multipart/form-data request content -- the filename is used by the service to infer the format of the input audio and decode it properly, as there's no other "hint" about whether the binary data should be interpreted as MP3, WAV, FLAC, etc.. That's why a filename shows up in each of the overloads:

  • One that accepts a Stream and a filename (the filename used exclusively for this "format hint" behavior)
  • One that just accepts a local filename (and reads the Stream automatically)

Is there another overload or input option you'd expect or like to see for these methods?

@cjkarande
Copy link
Author

cjkarande commented Jun 19, 2024

@trrwilson , for overloads accepting audio streams, accepting an audioFormat parameter in lieu of audioFilename would be more appropriate. The value for audioFilename may be derived internally based on the audioFormat. This will avoid any confusion for the API user. What do you say?

audioFormat parameter could be an enum of supported formats or a string
For ex.
enum AudioFormat {MP3, WAV, FLAC, ... }

public virtual ClientResult TranscribeAudio(Stream audio, AudioFormat audioFormat, AudioTranscriptionOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

@cjkarande
Copy link
Author

@trrwilson , for overloads accepting audio streams, accepting an audioFormat parameter in lieu of audioFilename would be more appropriate. The value for audioFilename may be derived internally based on the audioFormat. This will avoid any confusion for the API user. What do you say?

audioFormat parameter could be an enum of supported formats or a string For ex. enum AudioFormat {MP3, WAV, FLAC, ... }

public virtual ClientResult TranscribeAudio(Stream audio, AudioFormat audioFormat, AudioTranscriptionOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Hello @trrwilson , so can we have an overload as proposed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants