I am working with Amazon Polly, text-to-speech synthesizer.
My code is working but I want to hide the media player controller. Is that possible?
The use case is that the browser is an announcement device, that calls out messages using Amazon Polly. For example: "Order number 1234 is ready for pickup"
Code:
var key = Common.GetConfigValue("aws_key");
var secret = Common.GetConfigValue("aws_secret");
using (AmazonPollyClient client = new AmazonPollyClient(key, secret, Amazon.RegionEndpoint.USEast1)) {
var request = new SynthesizeSpeechRequest();
request.Text = "This is a test of amazon's polly text to speech";
request.OutputFormat = OutputFormat.Mp3;
request.VoiceId = VoiceId.Joanna;
var response = client.SynthesizeSpeech(request);
//WriteSpeechToStream(response.AudioStream, "speech.mp3");
byte[] data = null;
using (MemoryStream memoryStream = new MemoryStream()) {
response.AudioStream.CopyTo(memoryStream);
data = memoryStream.ToArray();
}
Response.Clear();
Response.ContentType = "audio/mpeg";
Response.AddHeader("Content-Disposition", "inline");
Response.AddHeader("Content-Length", data.Length.ToString());
Response.BinaryWrite(data);
}
This is what my web page displays. I want to hide the media player. There is nothing on the HTML side that constructs the player. The browser is automatically adding it to my page.

I can't post a comment as of yet so have to reply with an answer but I'm unsure if it's what you're looking for or trying to achieve. I'm assuming you have ASP.NET Razor page or some form of HTML. The code you have provided is server side and media controls etc are handled on the client side.
If you're using the HTML5 element to play the audio file, you have control over whether the controls are displayed:
The autoplay attribute will start playing the audio as soon as it's ready, and no controls will be displayed because the controls attribute is not included.
Other than that, there are vanilla JavaScript solutions where you have full control over the media player.
Apologies if this is not what you're looking for:
https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Client-side_web_APIs/Video_and_audio_APIs