Closed GraphicSound closed 4 years ago
@GraphicSound can you please provide flutter doctor -v
output, the phone specs, and if possible some example of the code or more detailed steps to be able to reproduce the issue?
@BondarenkoStas
Render the video player:
_showVideo
? new Align(
alignment: Alignment.topCenter,
child: Container(
color: themeDarkBackground,
child: AspectRatio(
aspectRatio:
// _videoPlayerController.value.aspectRatio,
widget.video['width'] /
widget.video['height'],
child: new Stack(children: <Widget>[
VideoPlayer(_videoPlayerController),
_isVideoLoading
? Positioned.fill(
child: Align(
child: CircularProgressIndicator(
valueColor:
new AlwaysStoppedAnimation<Color>(
Colors.white),
)))
: Container()
]),
),
))
: Container()
Start recording:
// Stop playing video
if (_videoPlayerController != null) {
log("hide video before recording");
if (_showVideo) {
_videoPlayerController.pause();
setState(() {
_showVideo = false;
});
}
}
setState(() {
_isRecording = !_isRecording;
});
Directory appDocDir = await getApplicationDocumentsDirectory();
String appDocPath = appDocDir.path;
if (_isRecording) {
_audioFilename = randomAlphaNumeric(11);
log(_audioFilename);
_flutterSound = new FlutterSound();
//// By default this option is disabled, you can enable it by calling
_flutterSound.setDbLevelEnabled(true);
_flutterSound.setDbPeakLevelUpdate(0.3);
// DISPOSE THE FREAKING VIDEO CONTROLLER
if (_videoPlayerController != null) {
log("DISPOSE THE FUCKING VIDEO CONTROLLER");
_videoPlayerController.dispose();
}
_originalAudioPath =
await _flutterSound.startRecorder(null, bitRate: 64000);
print('audio path: $_originalAudioPath');
_recorderSubscription = _flutterSound.onRecorderStateChanged.listen((e) {
if (e != null) {
_duration = e.currentPosition.toInt();
// log(_duration.toString());
}
});
_dbPeakSubscription =
_flutterSound.onRecorderDbPeakChanged.listen((value) {
// log(value.toString());
if (value != null) {
if (value.round() - _dbPeak > 10 || value.round() - _dbPeak < -10) {
setState(() {
// log(value.toString());
_dbPeak = value;
});
}
}
});
}
flutter doctor -v
[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.6 18G87, locale en-US)
• Flutter version 1.7.8+hotfix.4 at ...
• Framework revision 20e59316b8 (6 weeks ago), 2019-07-18 20:04:33 -0700
• Engine revision fee001c93f
• Dart version 2.4.0
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at ...
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.2.1, Build version 10E1001
• CocoaPods version 1.7.1
[✓] iOS tools - develop for iOS devices
• ios-deploy 1.9.4
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 38.2.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
Both my iphone 6 and iphone xr encounter this bug.
Hi @GraphicSound
Are you still experiencing this issue?
If so, can you please provide your flutter doctor -v
and flutter run --verbose
?
Also, to better address the issue, would be helpful if you could post a minimal code sample to reproduce the problem
Thank you
Hi @GraphicSound Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away! Thanks for your contribution.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v
and a minimal reproduction of the issue.
First of all, this bug only shows on iOS.
I'm writing a language learning app. So on one page, I'll play a short video first using Flutter video_player. Then I use flutter_sound to record the user's voice which allows them to practice speaking.
But most of the time, right after I start the recorder, the app will play the previous video's audio! Sometimes it's the whole audio being played and other times it's just a portion of it. And if I stop recording, the video's audio will be played again.
I've already made sure that the video player controller has been disposed. It looks like a cache or buffer issue?