diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 15be32b..5d2b713 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -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 diff --git a/lib/src/recorder.dart b/lib/src/recorder.dart index 1baf075..3efd4a4 100644 --- a/lib/src/recorder.dart +++ b/lib/src/recorder.dart @@ -87,16 +87,16 @@ class AudioRecorder { _isRecording = true; // Create recording stream - _recordingDataController = StreamController(); + _recordingDataController = StreamController(); _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); }