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

Recorder breaks synth #1744

Closed
walterbender opened this issue Mar 7, 2019 · 26 comments
Closed

Recorder breaks synth #1744

walterbender opened this issue Mar 7, 2019 · 26 comments
Assignees
Labels
Browser-Chrome Specific to Chrome browser Browser-Firefox Specific to Firefox Issue-Bug WF6-Needs testing Please test
Milestone

Comments

@walterbender
Copy link
Member

Fedora 29
FireFox 65.0.1
Suddenly stopped playing sounds. No idea why. Tone.js examples make sound, so it is something in MB itself.

@walterbender walterbender added Issue-Bug Browser-Firefox Specific to Firefox labels Mar 7, 2019
@walterbender
Copy link
Member Author

Work fine in Chromium.

@digitaldybbuk
Copy link
Contributor

digitaldybbuk commented Mar 7, 2019

Works on Safari (OSX and iPhone)
I also cannot hear sound in Firefox (65.0.1 64-bit - Mac OS X 10.13.6)
Could not hear sound on 65.0.2 (64-bit) on i3 (Windows 7 64-bit)
Could not hear sound on 64.0.2 (64 bit) on i3 (Windows 7 64-bit)
Unfortunately it looks like Tone.js v12 brings back the sound for firefox and still works on chrome but then its not audible on Safari(OSX,iphone)... (current version we are using is v13)

@digitaldybbuk
Copy link
Contributor

However it does seem as though it is something in MB since Tone.js examples using older versions work on Firefox as well as Safari - but that is not the case with MB

@walterbender
Copy link
Member Author

walterbender commented Mar 7, 2019

I will try testing some older versions to see if they work.

v2.0 runs fine.
v2.6 runs fine
v2.7 runs fine

so...

@walterbender
Copy link
Member Author

walterbender commented Mar 7, 2019

When I used the new Tone.js with the v2.7, it no longer played sounds. So somehow the combination of the new Tone.js and the new Firefox triggers a problem with the MB code. Both versions work fine with Chromium.

The latest code with the old Tone.js works fine in Firefox.

@sum2it
Copy link
Collaborator

sum2it commented Mar 11, 2019

Seems like the issue was reproduced, finally. One step forward in bug discovery!
#1733

@pikurasa
Copy link
Collaborator

pikurasa commented Apr 6, 2019

If this issue lingers for long, it would be helpful for me if we had a separate branch with our latest code, but a version of tone.js that works with FF. The reason is, for many of my classes we are running FF and Chromium is not installed. Therefore, I cannot provide the class with latest bits (nor have the class help test them).

@walterbender
Copy link
Member Author

A branch is easy enough, But we'll have to keep it up to date.

@walterbender
Copy link
Member Author

@pikurasa
Copy link
Collaborator

pikurasa commented Apr 8, 2019

https://github.com/sugarlabs/musicblocks/tree/FireFox-tonejs-regression should work on FF

Yes, it works.

Thanks!

@im-gozmit
Copy link

Hello @walterbender,
While I was testing MB on:

  1. Browser: Firefox 66.0.2 (64-bit)
    OS: Microsoft Windows 10.
  2. Browser: Firefox 66.0.2 (64-bit)
    OS: Ubuntu 18.04.2 amd-64.

Sound is not playing while block gets executed.

@walterbender
Copy link
Member Author

walterbender commented Apr 8, 2019

You can add Fedora 29 to the list.
But the simple example below plays. Must be something we are doing wrong.

simpleHtml.html.gz

@im-gozmit
Copy link

@walterbender Thanks,
I will test on other OS and browsers as well and currently I am understanding the code base of MB to get the solution of the problem.

@pikurasa
Copy link
Collaborator

pikurasa commented Apr 9, 2019

@im-gozmit I recommend viewing the recent changes made in wrt tone.js

For example, we recently 1) upgraded and 2) changed from minified code to un-minified. Perhaps something bubbled up due to these changes.

@walterbender
Copy link
Member Author

Just did a little experiment:
First I added all the scripts (mostly imports) from head of index.html to the simpleHtml script and the tone still played. Then I added the init() and that broke it. So something we are doing in init is the culprit.

@walterbender
Copy link
Member Author

I have isolated it to synthutils.js. But no idea what the problem is there.

@walterbender
Copy link
Member Author

I have isolated the problem to one line:
this.recorder = new Recorder(Tone.Master);

If we don't create the Recorder, FF works!!!

Now to figure out why the Recorder breaks things.

@walterbender
Copy link
Member Author

A simple test case:

simpleHtml.html.gz

Adding the Recorder line break it in FF but not Chrome.

@walterbender
Copy link
Member Author

I think we should replace lib/recorder.js rather than try to fix it because it doesn't seem to have a license. @eohomegrownapps where did you get this module from?

@walterbender
Copy link
Member Author

https://tonejs.github.io/docs/r13/Tone#offline-static might offer a better approach to rendering audio for recording purposes.

https://tonejs.github.io/examples/offline.html <<---- example of how to use it.

@euanong
Copy link
Member

euanong commented Apr 12, 2019

@walterbender The module I used was https://github.com/mattdiamond/Recorderjs - it captures the output of a web audio node and allows it to be exported as WAV (for more information see logo.js, L8914). A licenced alternative could be https://github.com/Jam3/audiobuffer-to-wav (MIT licence); I might look into this if I have time later today.

@pikurasa
Copy link
Collaborator

I think it is also worth it (whatever we decide) to notify the developer of the lack of license.

@walterbender
Copy link
Member Author

I put a test in for FF and don't enable saveWAV when FF is the browser as a temporary work-around until we get around to fixing this.

9475184

@walterbender walterbender reopened this May 4, 2019
@walterbender walterbender changed the title fails to play sounds on Firefox Recorder breaks synth on Firefox Oct 6, 2019
@walterbender walterbender added the Browser-Chrome Specific to Chrome browser label Nov 10, 2019
@walterbender walterbender changed the title Recorder breaks synth on Firefox Recorder breaks synth Nov 10, 2019
@walterbender
Copy link
Member Author

The most recent version of Tone.js breaks Chrome too... we need a new approach.

@pikurasa
Copy link
Collaborator

This works for me...

(I didn`t know that we had save as wav again...)

@pikurasa
Copy link
Collaborator

Just FYI, it records as "ogg" although it says "save as wav"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Browser-Chrome Specific to Chrome browser Browser-Firefox Specific to Firefox Issue-Bug WF6-Needs testing Please test
Projects
None yet
Development

No branches or pull requests

7 participants