Skip to content
This repository was archived by the owner on Nov 10, 2022. It is now read-only.
This repository was archived by the owner on Nov 10, 2022. It is now read-only.

Send byte array from audio recorded with Chrome (MediaRecorder API) #19

@crisro96

Description

@crisro96

I am recording an audio message in Chrome (and Firefox) using the MediaRecorder API. The options for the stream are set to webm/opus for Chrome and ogg/opus for Firefox I successfully saved files from both browsers on my PC and can be played using VLC. On my Java application I read the audio files as byte arrays and straight up run the provided sample for audio to dialogflow with the following change:

var audioEncoding = AudioEncoding.AUDIO_ENCODING_OGG_OPUS;
			var sampleRateHz = 48000; // 8000, 12000, 16000, 24000, 48000
			var inputAudioConfig = InputAudioConfig.newBuilder()
                                                               .setAudioEncoding(audioEncoding)
                                                               .setLanguageCode("en-US")
                                                               .setSampleRateHertz(sampleRateHz)
                                                               .build();

Both audio files are a recording saying "This is a test". The Firefox version will return the default response from my DialogFlow agent, while the Chrome version will simply return an empty response (not NULL, just doesn't contain any data - see screenshot).

OS: Windows;
Java version: 10

desktop screenshot 2018 06 09 - 02 30 32 85

Edit: this also seems to happen with a .wav file with AudioEncoding set to AUDIO_ENCODING_LINEAR16;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions