Playing sounds in Browser widget on Windows 10

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
markosborne
Posts: 15
Joined: Sat Mar 20, 2010 6:03 pm

Playing sounds in Browser widget on Windows 10

Post by markosborne » Wed Nov 07, 2018 2:52 pm

Hello All,

We are developing a Livecode application that is using the Browser widget to display a web page. It's an educational app for young learners. The web page has a list of words. When a word is clicked, a picture showing the meaning of the word is displayed and a recording of the word being spoken is played. For example, click 'cat' and you will briefly see a picture of a cat and hear someone saying 'cat'.

I'm developing on macOS 10.12.6 using Livecode Indy 9.0.1. In the Livecode IDE everything is fine, a standalone app for macOS works fine, however, the standalone app for Windows shows the pictures but does not play the audio - no sounds at all (Windows 10).

The web page is using JavaScript to show the graphics and play the audio. The code to play the audio is:
var audio = new Audio('word/' + myFile + '.mp3');
audio.play();

Any thoughts anybody as to why it's not playing sound on Windows 10 (same app works fine in a standard browser, e.g. Firefox)?

markosborne
Posts: 15
Joined: Sat Mar 20, 2010 6:03 pm

Re: Playing sounds in Browser widget on Windows 10

Post by markosborne » Fri Nov 09, 2018 3:19 pm

The answer to this is that on Windows (and Linux) the Browser widget in LiveCode uses Chromium Embedded Framework (CEF) and its support for MP3 audio is disabled for legal reasons by default. See https://stackoverflow.com/questions/123 ... tml5-audio

It can play WAV file just fine (but these are much larger than MP3), however, I can't get OGG to work at all in the LiveCode IDE on macOS.

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Playing sounds in Browser widget on Windows 10

Post by Klaus » Sat Nov 10, 2018 12:06 am

Hi Mark,

as far as I know WebKit, the browser framework on the Mac, which is used by LC and also Safari, does not support OGG files.


Best

Klaus

Post Reply

Return to “Internet”