mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-09 12:39:29 +00:00
migrate to just audio
This commit is contained in:
parent
a1dd0e9d3f
commit
01b3dead49
22 changed files with 1062 additions and 340 deletions
|
|
@ -1,5 +1,10 @@
|
|||
import 'package:audio_session/audio_session.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:just_audio_background/just_audio_background.dart'
|
||||
show JustAudioBackground;
|
||||
import 'package:just_audio_media_kit/just_audio_media_kit.dart'
|
||||
show JustAudioMediaKit;
|
||||
import 'package:whispering_pages/api/server_provider.dart';
|
||||
import 'package:whispering_pages/db/storage.dart';
|
||||
import 'package:whispering_pages/router/router.dart';
|
||||
|
|
@ -10,9 +15,24 @@ import 'package:whispering_pages/theme/theme.dart';
|
|||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
// for playing audio on windows, linux
|
||||
JustAudioMediaKit.ensureInitialized();
|
||||
|
||||
// initialize the storage
|
||||
await initStorage();
|
||||
|
||||
// for configuring how this app will interact with other audio apps
|
||||
final session = await AudioSession.instance;
|
||||
await session.configure(const AudioSessionConfiguration.speech());
|
||||
|
||||
// for playing audio in the background
|
||||
await JustAudioBackground.init(
|
||||
androidNotificationChannelId: 'com.whispering_pages.bg_demo.channel.audio',
|
||||
androidNotificationChannelName: 'Audio playback',
|
||||
androidNotificationOngoing: true,
|
||||
);
|
||||
|
||||
// run the app
|
||||
runApp(
|
||||
const ProviderScope(
|
||||
child: MyApp(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue