remove more audio
This commit is contained in:
parent
8edabe654f
commit
61cbe74547
@ -100,6 +100,7 @@ class FfiModel with ChangeNotifier {
|
|||||||
} else if (name == "audio_format") {
|
} else if (name == "audio_format") {
|
||||||
() async {
|
() async {
|
||||||
try {
|
try {
|
||||||
|
/*
|
||||||
var s = int.parse(evt['sample_rate']);
|
var s = int.parse(evt['sample_rate']);
|
||||||
// var c = int.parse(evt['channels']);
|
// var c = int.parse(evt['channels']);
|
||||||
// Flutter Sound does not support Floating Point PCM data, nor records with more that one audio channel.
|
// Flutter Sound does not support Floating Point PCM data, nor records with more that one audio channel.
|
||||||
@ -107,6 +108,7 @@ class FfiModel with ChangeNotifier {
|
|||||||
await stopAudio();
|
await stopAudio();
|
||||||
await _audioPlayer.startPlayerFromStream(
|
await _audioPlayer.startPlayerFromStream(
|
||||||
codec: Codec.pcm16, numChannels: 1, sampleRate: s);
|
codec: Codec.pcm16, numChannels: 1, sampleRate: s);
|
||||||
|
*/
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('audio_format: $e');
|
print('audio_format: $e');
|
||||||
}
|
}
|
||||||
@ -138,11 +140,13 @@ class FfiModel with ChangeNotifier {
|
|||||||
}
|
}
|
||||||
var frame = FFI._getAudio();
|
var frame = FFI._getAudio();
|
||||||
if (frame != null && frame != nullptr) {
|
if (frame != null && frame != nullptr) {
|
||||||
final ref = frame.ref;
|
|
||||||
final bytes = Uint8List.sublistView(ref.data.asTypedList(ref.len));
|
|
||||||
() async {
|
() async {
|
||||||
try {
|
try {
|
||||||
// await _audioPlayer.feedFromStream(bytes);
|
/*
|
||||||
|
final ref = frame.ref;
|
||||||
|
final bytes = Uint8List.sublistView(ref.data.asTypedList(ref.len));
|
||||||
|
await _audioPlayer.feedFromStream(bytes);
|
||||||
|
*/
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('play audio frame: $e');
|
print('play audio frame: $e');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user