Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suriya/wipe #30

Merged
merged 5 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions .github/workflows/01_build_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ jobs:
- name: Build Appimage
run: bash ./dev/github_linux_appimage_build.sh
- name: Compress action step
run: tar -C build/linux/x64/release/bundle -cf lang-fe-linux.tar.gz ./
run: tar -C build/linux/x64/release/bundle -cf speaksharp-linux.tar.gz ./
- name: Linux Release
uses: actions/upload-artifact@v4
with:
name: lang-fe-linux
path: lang-fe-linux.tar.gz
name: speaksharp-linux
path: speaksharp-linux.tar.gz
# - name: decode key base64
# run: echo $KEYSTORE_BASE64 | base64 -di > ./android/app/lang-fe.jks
# run: echo $KEYSTORE_BASE64 | base64 -di > ./android/app/speaksharp.jks
# env:
# KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
- uses: actions/setup-java@v2
Expand All @@ -51,14 +51,14 @@ jobs:
flutter build apk --release
flutter build apk --release --split-per-abi
# env:
# KEYSTORE: lang-fe.jks
# KEYSTORE: speaksharp.jks
# KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
# KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
# KEY_PASSWORD: ${{ secrets.KEY_PASSWORD}}
- name: Android Release
uses: actions/upload-artifact@v4
with:
name: lang-fe-android
name: speaksharp-android
path: build/app/outputs/flutter-apk


Expand Down Expand Up @@ -87,12 +87,12 @@ jobs:
- name: create dev file
run: dart dev\windows_evb_config_generator.dart
- name: build single exe file
run: enigmavirtualbox cli "lang-fe.evb"
run: enigmavirtualbox cli "speaksharp.evb"
- name: Windows Release
uses: actions/upload-artifact@v4
with:
name: lang-fe-win
path: lang_fe.exe
name: speaksharp-win
path: speaksharp.exe

build-and-release-macos:
runs-on: macos-14
Expand All @@ -114,22 +114,22 @@ jobs:
- name: install appdmg
run: npm install -g appdmg
- name: build dmg
run: appdmg ./dmg/config.json ./build/macos/Build/Products/Release/lang-fe.dmg
run: appdmg ./dmg/config.json ./build/macos/Build/Products/Release/speaksharp.dmg
- name: macOS Release
uses: actions/upload-artifact@v4
with:
name: lang-fe-macos
path: build/macos/Build/Products/Release/lang-fe.dmg
name: speaksharp-macos
path: build/macos/Build/Products/Release/speaksharp.dmg
- name: Build ios
run: |
flutter build ios --release --no-codesign
ln -sf ./build/ios/iphoneos Payload
zip -r9 lang-fe-release.ipa Payload/runner.app
zip -r9 speaksharp-release.ipa Payload/runner.app
- name: ios Release
uses: actions/upload-artifact@v4
with:
name: lang-fe-ios
path: lang-fe-release.ipa
name: speaksharp-ios
path: speaksharp-release.ipa
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
Expand All @@ -146,7 +146,7 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
path: ./lang-fe-release
path: ./speaksharp-release
merge-multiple: true
- name: Install dependenciesw
run: sudo apt-get install tree -y
Expand All @@ -158,4 +158,4 @@ jobs:
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
allowUpdates: true
artifacts: lang-fe-release/*
artifacts: speaksharp-release/*
2 changes: 1 addition & 1 deletion integration_test/integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:lang_fe/main.dart' as app;
import 'package:speaksharp/main.dart' as app;

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
Expand Down
4 changes: 2 additions & 2 deletions lib/component_screen.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:lang_fe/pages/audio_player.dart';
import 'package:lang_fe/pages/recording_page.dart';
import 'package:speaksharp/pages/audio_player.dart';
import 'package:speaksharp/pages/recording_page.dart';

import 'db/recording_models.dart';

Expand Down
1 change: 1 addition & 0 deletions lib/const/consts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const String jobStatusUri = "/api/v1/check_job_status/";
const String downloadZipUri = "/api/v1/speaker-turn/download/";
const downloadAudioJsonUri = "/api/v1/speaker-turn/download_json/";
const String clientEventUploadUri = "/api/v1/client_event_upload/";
const String downloadAuthenticAudio = "/api/v1/speaker-turn/download_authentic_audio/";

// FilePaths
const String audioPath = "audio";
Expand Down
6 changes: 3 additions & 3 deletions lib/db/db_helper.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import 'package:flutter/foundation.dart';
import 'package:lang_fe/db/recording_models.dart';
import 'package:lang_fe/db/sample_recording_models.dart';
import 'package:speaksharp/db/recording_models.dart';
import 'package:speaksharp/db/sample_recording_models.dart';
import 'package:path/path.dart';
import 'package:sqflite/sqflite.dart';
import 'package:sqflite_common_ffi_web/sqflite_ffi_web.dart';

import 'user_models.dart'; // Import your data model
// import 'sample_recording_models.dart'; // Import your data model
import 'package:lang_fe/const/consts.dart';
import 'package:speaksharp/const/consts.dart';

// Create and manage database from here. Creation of new models need to be registered here.
//
Expand Down
4 changes: 2 additions & 2 deletions lib/db/user_models.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:lang_fe/const/consts.dart';
import 'package:lang_fe/db/db_helper.dart';
import 'package:speaksharp/const/consts.dart';
import 'package:speaksharp/db/db_helper.dart';
import 'package:path/path.dart';
import 'package:sqflite/sqflite.dart';
import 'package:collection/collection.dart';
Expand Down
6 changes: 3 additions & 3 deletions lib/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import 'dart:convert';

import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:lang_fe/pages/auth.dart';
import 'package:lang_fe/pages/profile_page.dart';
import 'package:speaksharp/pages/auth.dart';
import 'package:speaksharp/pages/profile_page.dart';
import 'package:provider/provider.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:lang_fe/provider/app_basic_provider.dart';
import 'package:speaksharp/provider/app_basic_provider.dart';

import 'component_screen.dart';
import 'constants.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/login_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:lang_fe/req/login_req.dart';
import 'package:lang_fe/utils/misc.dart';
import 'package:speaksharp/req/login_req.dart';
import 'package:speaksharp/utils/misc.dart';

import 'db/user_models.dart';

Expand Down
6 changes: 3 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:lang_fe/provider/app_basic_provider.dart';
import 'package:lang_fe/req/client_event_upload.dart';
import 'package:speaksharp/provider/app_basic_provider.dart';
import 'package:speaksharp/req/client_event_upload.dart';
import 'package:package_info_plus/package_info_plus.dart';
// import 'package:lang_fe/utils/navigator_util.dart';
// import 'package:speaksharp/utils/navigator_util.dart';
import 'package:provider/provider.dart';
import 'package:web_startup_analyzer/web_startup_analyzer.dart';

Expand Down
6 changes: 3 additions & 3 deletions lib/pages/audio_page.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:lang_fe/db/recording_models.dart';
import 'package:lang_fe/pages/audio_player.dart';
import 'package:lang_fe/provider/app_basic_provider.dart';
import 'package:speaksharp/db/recording_models.dart';
import 'package:speaksharp/pages/audio_player.dart';
import 'package:speaksharp/provider/app_basic_provider.dart';
import 'package:provider/provider.dart';

// import 'audio_player.dart';
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/audio_player.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import 'dart:async';

import 'package:audioplayers/audioplayers.dart' as ap;

// import 'package:audioplayers/audioplayers.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:lang_fe/provider/app_basic_provider.dart';
import 'package:speaksharp/provider/app_basic_provider.dart';
import 'package:provider/provider.dart';

class CustomAudioPlayer extends StatefulWidget {
Expand Down
46 changes: 15 additions & 31 deletions lib/pages/audio_recorder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:lang_fe/provider/app_basic_provider.dart';
import 'package:speaksharp/provider/app_basic_provider.dart';
import 'package:provider/provider.dart';
import 'package:record/record.dart';

Expand All @@ -11,7 +11,6 @@ import 'platform/audio_recorder_platform.dart';
class Recorder extends StatefulWidget {
final Future<void> Function(String path) onStop;
final String waitToText;
final bool isSampleRecord = false;

const Recorder({super.key, required this.onStop, required this.waitToText});

Expand Down Expand Up @@ -66,10 +65,8 @@ class _RecorderState extends State<Recorder> with AudioRecorderMixin {
encoder: AudioEncoder.wav,
bitRate: 256000,
sampleRate: 16000,
numChannels: 1,
autoGain: true,
echoCancel: false,
noiseSuppress: true);
numChannels: 1
);

// Record to file
await recordFile(_audioRecorder, config);
Expand Down Expand Up @@ -147,11 +144,7 @@ class _RecorderState extends State<Recorder> with AudioRecorderMixin {
// bottom: Radius.circular(8.0),
// ),
),
padding: widget.isSampleRecord
? ((_recordState != RecordState.stop)
? const EdgeInsets.fromLTRB(24, 160, 24, 20)
: const EdgeInsets.fromLTRB(24, 80, 24, 20))
: const EdgeInsets.fromLTRB(24, 20, 24, 0),
padding: const EdgeInsets.fromLTRB(24, 20, 24, 0),
child: (_recordState != RecordState.stop)
? Container(
padding: const EdgeInsets.only(bottom: 12.0),
Expand All @@ -160,17 +153,14 @@ class _RecorderState extends State<Recorder> with AudioRecorderMixin {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Padding(
padding: widget.isSampleRecord
? EdgeInsets.only(bottom: 24.0)
: EdgeInsets.only(bottom: 12.0),
padding: EdgeInsets.only(bottom: 12.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
_buildRecordStopControl(
Theme.of(context)
.primaryColor
.withOpacity(0.5),
widget.isSampleRecord),
.withOpacity(0.5),),
SizedBox(width: 8),
_buildPauseResumeControl(),
SizedBox(width: 8),
Expand All @@ -188,15 +178,13 @@ class _RecorderState extends State<Recorder> with AudioRecorderMixin {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Padding(
padding: widget.isSampleRecord
? EdgeInsets.only(bottom: 24.0)
: EdgeInsets.only(bottom: 12.0),
padding: const EdgeInsets.only(bottom: 12.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
_buildRecordStopControl(
Theme.of(context).primaryColor.withOpacity(0.5),
widget.isSampleRecord),
),
]),
),
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Expand All @@ -214,14 +202,14 @@ class _RecorderState extends State<Recorder> with AudioRecorderMixin {
super.dispose();
}

Widget _buildRecordStopControl(Color _color, bool isSampleRecord) {
Widget _buildRecordStopControl(Color _color) {
return Container(
width: (!isSampleRecord || _recordState != RecordState.stop)
width: (_recordState != RecordState.stop)
? 60.0
: 120.0,
height: (!isSampleRecord || _recordState != RecordState.stop)
: 60.0,
height: ( _recordState != RecordState.stop)
? 60.0
: 120.0,
: 60.0,
decoration: BoxDecoration(
color: (_recordState != RecordState.stop)
? Colors.black.withOpacity(0.05)
Expand All @@ -232,12 +220,8 @@ class _RecorderState extends State<Recorder> with AudioRecorderMixin {
child: IconButton(
selectedIcon: const Icon(Icons.pause, size: 80.0),
icon: (_recordState != RecordState.stop)
? (isSampleRecord
? const Icon(Icons.stop, size: 40.0)
: const Icon(Icons.stop, size: 40.0, color: Colors.red))
: (isSampleRecord
? const Icon(Icons.mic, size: 80.0, color: Colors.white)
: const Icon(Icons.mic, size: 40.0, color: Colors.white)),
? (const Icon(Icons.stop, size: 40.0, color: Colors.red))
: (const Icon(Icons.mic, size: 40.0, color: Colors.white)),
onPressed: () {
setState(() {
(_recordState != RecordState.stop) ? _stop() : _start();
Expand Down
6 changes: 3 additions & 3 deletions lib/pages/auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import 'package:flutter/material.dart';
import 'package:flutter_facebook_auth/flutter_facebook_auth.dart';
import 'package:flutter_signin_button/flutter_signin_button.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:lang_fe/main.dart';
import 'package:lang_fe/pages/login_email_password_screen.dart';
import 'package:lang_fe/pages/signup_email_password_screen.dart';
import 'package:speaksharp/main.dart';
import 'package:speaksharp/pages/login_email_password_screen.dart';
import 'package:speaksharp/pages/signup_email_password_screen.dart';

typedef OAuthSignIn = void Function();

Expand Down
4 changes: 2 additions & 2 deletions lib/pages/login_email_password_screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:lang_fe/provider/app_basic_provider.dart';
import 'package:lang_fe/req/firebase_auth_methods.dart';
import 'package:speaksharp/provider/app_basic_provider.dart';
import 'package:speaksharp/req/firebase_auth_methods.dart';
import 'package:provider/provider.dart';

import '../main.dart';
Expand Down
6 changes: 3 additions & 3 deletions lib/pages/profile_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import 'dart:developer';

import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:lang_fe/main.dart';
import 'package:lang_fe/provider/app_basic_provider.dart';
import 'package:speaksharp/main.dart';
import 'package:speaksharp/provider/app_basic_provider.dart';
import 'package:provider/provider.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:lang_fe/pages/themer.dart';
import 'package:speaksharp/pages/themer.dart';

import '../constants.dart';
import 'auth.dart';
Expand Down
Loading