Skip to content

Commit

Permalink
Before adding flutter sound as submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
Larpoux committed Feb 8, 2025
1 parent ca52bc9 commit fd31257
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## 0.0.14-alpha.4
## 0.0.14-alpha.5

* TODO: Describe initial release.
10 changes: 8 additions & 2 deletions assets/js/async_processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,18 @@ class AsyncProcessor extends AudioWorkletProcessor {
switch (msgType)
{
case 'SEND_DATA': this.send(outputNo, data); break;
case 'STOP': this.stop(); break;
}

};
}

bufferUndeflow(outputNo)
stop()
{
chunksArray = [];
}

bufferUnderflow(outputNo)
{
this.port.postMessage({'messageType' : 'AUDIO_BUFFER_UNDERFLOW', 'inputNo' : -1, 'outputNo' : outputNo});
}
Expand Down Expand Up @@ -113,7 +119,7 @@ class AsyncProcessor extends AudioWorkletProcessor {
let numberOfChunks = this.chunksArray[outNo].length; // Just for debugging
if (numberOfChunks == 0)
{
this.bufferUndeflow(0); // don't do that when debugging!!!
this.bufferUnderflow(0); // don't do that when debugging!!!
return; // No more data
}
let nextChunk = this.chunksArray[outNo][0];
Expand Down
1 change: 1 addition & 0 deletions bin/setver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ gsed -i "s/^\( *tau_web: *#* *\^*\).*$/\1$VERSION/"
gsed -i "s/^\( *tau_web: *#* *\^*\).*$/\1$VERSION/" ../etau/example/pubspec.yaml
gsed -i "s/^\( *tau_web: *#* *\^*\).*$/\1$VERSION/" ../../flutter_sound/flutter_sound/example/pubspec.yaml
gsed -i "s/^\( *tau_web: *#* *\^*\).*$/\1$VERSION/" ../../flutter_sound/flutter_sound/pubspec.yaml
gsed -i "s/^\( *tau_web: *#* *\^*\).*$/\1$VERSION/" ../../flutter_sound/flutter_sound_web/pubspec.yaml
gsed -i "s/^\( *## \).*$/\1$VERSION/" CHANGELOG.md

gsed -i "s/^TAU_WEB_VERSION:.*/TAU_WEB: $VERSION/" ../tau_doc/_config.yml
Expand Down
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ description: "An example showing how to use the etau implementation for the Web.
# This version is used _only_ for the Runner app, which is used if you just do
# a `flutter run` or a `flutter make-host-app-editable`. It has no impact
# on any other native host app that you embed your Flutter project into.
version: 0.0.14-alpha.4
version: 0.0.14-alpha.5

environment:
sdk: ^3.5.3
Expand All @@ -27,7 +27,7 @@ dependencies:
tau_wars: ^0.0.14-alpha.4
# path: ../ # tau_wars Dir

etau: # ^0.0.14-alpha.4
etau: # ^0.0.14-alpha.5
path: ../../etau # etau Dir

# The following adds the Cupertino Icons font to your application.
Expand Down
12 changes: 9 additions & 3 deletions lib/src/tauweb_class.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2673,8 +2673,7 @@ class AudioWorkletNode extends AudioNode implements t.AudioWorkletNode {
class AsyncWorkletNode extends AudioWorkletNode implements t.AsyncWorkletNode {
t.OnAudioBufferUnderflowFn _onAudioBufferUnderflow = (int outputNo) {};

t.OnReceiveDataFn _onReceiveData = (int outputNo, List<Float32List>? data)
{
t.OnReceiveDataFn _onReceiveData = (int outputNo, List<Float32List>? data) {
// Dummy
};

Expand Down Expand Up @@ -2722,6 +2721,13 @@ class AsyncWorkletNode extends AudioWorkletNode implements t.AsyncWorkletNode {
obj.setProperty('data'.toJS, Interop().jsArrayFloats(data));
port.postMessage(obj);
}

@override
void stop() {
JSObject obj = JSObject();
obj.setProperty('msgType'.toJS, 'STOP'.toJS);
port.postMessage(obj);
}
}

// =================================================================================================
Expand Down Expand Up @@ -2978,7 +2984,7 @@ class MediaDevices implements t.MediaDevices {

@override
Future<MediaStream> getUserMedia(
{bool audio = true, bool video = true}) async {
{bool audio = true, bool video = false}) async {
var l = await delegate
.getUserMedia(_mediaConstraints(audio: audio, video: video))
.toDart;
Expand Down
1 change: 0 additions & 1 deletion lib/tau_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ import 'src/tauweb_implementation.dart' show TauwebJS;

TauInterface tau() => TauwebImplementation();
TauwebJS tauwebJS() => TauwebJS();

4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: tau_web
description: "A E_τ (Etau) implementation for the Web."
version: 0.0.14-alpha.4
version: 0.0.14-alpha.5
homepage: https://tau.canardoux.xyz
repository: https://github.com/canardoux/tau_web

Expand All @@ -12,7 +12,7 @@ dependencies:
flutter:
sdk: flutter

etau: # ^0.0.14-alpha.4
etau: # ^0.0.14-alpha.5
path: ../etau # etau Dir

web: ^1.0.0
Expand Down

0 comments on commit fd31257

Please sign in to comment.