|
|
@@ -30,13 +30,14 @@ import { AnimationHelper, DialogAction, DialogHelper } from '@pura/harmony-dialo
|
|
|
import { fileIo, fileUri, picker } from '@kit.CoreFileKit';
|
|
|
import { MessageEvents, util, worker, ErrorEvent } from '@kit.ArkTS';
|
|
|
import { Verify } from './Verify';
|
|
|
+import { taskpool } from '@kit.ArkTS';
|
|
|
import { RotatingCover } from './RotatingCover';
|
|
|
import { PlayConstants } from '../common/constants/PlayConstants';
|
|
|
import { effectKit } from '@kit.ArkGraphics2D';
|
|
|
import { ColorConversion } from '../common/util/ColorConversion';
|
|
|
import { LyricController, LyricParser, LyricView2 } from '@seagazer/cclyric';
|
|
|
import { AvSessionController } from '../controller/AvSessionController';
|
|
|
-import { repairAudioMetadata, getApiLyric,changeMusicCover} from '../common/util/MusicTagUtils';
|
|
|
+import { repairAudioMetadata, convertDsfToWav, getApiLyric,changeMusicCover} from '../common/util/MusicTagUtils';
|
|
|
import { FFMpegTags,Utility } from '../common/util/Utility';
|
|
|
import { TagsContentCover } from '../view/TagsContentCover';
|
|
|
import { ImageFancyModifier } from '../common/util/AttributeModifierUtil'
|
|
|
@@ -5132,9 +5133,7 @@ export struct LocalMusic {
|
|
|
this.cover = this.currentSong.pixelMapPath
|
|
|
this.artist = this.currentSong.artist
|
|
|
LogUtil.info('this.currentSong.duration =' + this.currentSong.duration)
|
|
|
- LogUtil.info('this.currentSong.sampleRate =' + this.currentSong.sampleRate)
|
|
|
LogUtil.info('this.currentSongmimeType =' + this.currentSong.mimeType)
|
|
|
- console.info('onecold startPlayOrResumePlay 4547')
|
|
|
this.startPlayOrResumePlay()
|
|
|
break;
|
|
|
|
|
|
@@ -11000,6 +10999,33 @@ export struct LocalMusic {
|
|
|
}
|
|
|
|
|
|
private startPlayOrResumePlay() {
|
|
|
+ //针对dsf文件高采样率sampleRate>441000,统一转wav播放
|
|
|
+ const sampleRate = this.currentSong?.sampleRate||0
|
|
|
+ if(this.videoUrl.toLowerCase().endsWith('.dsf')&&sampleRate>=441000){
|
|
|
+ console.info('onecold 采样率 ='+sampleRate)
|
|
|
+ let newDsfPath = this.context.filesDir + '/'+FileUtil.getFileName(this.videoUrl)+'.wav'
|
|
|
+ console.info('onecold newDsfPath ='+newDsfPath)
|
|
|
+ if(!FileUtil.accessSync(newDsfPath)){
|
|
|
+ const task = new taskpool.Task(convertDsfToWav,this.videoUrl,newDsfPath);
|
|
|
+ taskpool.execute(task, taskpool.Priority.HIGH).then((data)=>{
|
|
|
+ this.videoUrl = newDsfPath
|
|
|
+ this.startPlay()
|
|
|
+ }).catch((e:object)=>{
|
|
|
+ console.info("task1 catch e: " + e);
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.videoUrl = newDsfPath
|
|
|
+ this.startPlay()
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.startPlay()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ startPlay() {
|
|
|
this.startPipLyric()
|
|
|
this.mDestroyPage = false;
|
|
|
this.animationState = AnimationStatus.Running
|