Skip to content

Commit

Permalink
Fixed typing to accord with latest flutter_audio package
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinbjornt committed Aug 13, 2024
1 parent 653bee9 commit 9a26fb6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
namespace 'is.mideind.embla_core_example'
namespace 'com.example.example'

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down
8 changes: 4 additions & 4 deletions lib/src/recorder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ class AudioRecorder {
_isRecording = true;

// Create recording stream
_recordingDataController = StreamController<Food>();
_recordingDataController = StreamController<Uint8List>();
_recordingDataSubscription = _recordingDataController?.stream.listen((buffer) {
if (buffer is FoodData && buffer.data != null) {
final data = buffer.data as Uint8List;
if (buffer is Uint8List && buffer != null) {
final data = buffer;
_totalAudioDataSize += data.lengthInBytes;
_totalAudioDuration = _totalAudioDataSize / (kAudioSampleRate * 2);
dataHandler(data); // Invoke callback
dlog(_totalAudioDuration);
} else {
final errMsg = 'Got null data in recording stream: $buffer';
const errMsg = 'Bad data in recording stream';
dlog(errMsg);
errHandler(errMsg);
}
Expand Down

0 comments on commit 9a26fb6

Please sign in to comment.