Skip to content

Commit 9a26fb6

Browse files
committed
Fixed typing to accord with latest flutter_audio package
1 parent 653bee9 commit 9a26fb6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2828
android {
2929
compileSdkVersion flutter.compileSdkVersion
3030
ndkVersion flutter.ndkVersion
31-
namespace 'is.mideind.embla_core_example'
31+
namespace 'com.example.example'
3232

3333
compileOptions {
3434
sourceCompatibility JavaVersion.VERSION_1_8

lib/src/recorder.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,16 @@ class AudioRecorder {
8787
_isRecording = true;
8888

8989
// Create recording stream
90-
_recordingDataController = StreamController<Food>();
90+
_recordingDataController = StreamController<Uint8List>();
9191
_recordingDataSubscription = _recordingDataController?.stream.listen((buffer) {
92-
if (buffer is FoodData && buffer.data != null) {
93-
final data = buffer.data as Uint8List;
92+
if (buffer is Uint8List && buffer != null) {
93+
final data = buffer;
9494
_totalAudioDataSize += data.lengthInBytes;
9595
_totalAudioDuration = _totalAudioDataSize / (kAudioSampleRate * 2);
9696
dataHandler(data); // Invoke callback
9797
dlog(_totalAudioDuration);
9898
} else {
99-
final errMsg = 'Got null data in recording stream: $buffer';
99+
const errMsg = 'Bad data in recording stream';
100100
dlog(errMsg);
101101
errHandler(errMsg);
102102
}

0 commit comments

Comments
 (0)