質問編集履歴
5
誤字の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -37,7 +37,7 @@
|
|
37
37
|
}
|
38
38
|
```
|
39
39
|
**chacheURL**を出力すると下記のようにパスが出ています。
|
40
|
-
/var/mobile/Containers/Data/Application/******-******-******-******-
|
40
|
+
/var/mobile/Containers/Data/Application/******-******-******-******-********/Library/Caches/********/audio/JS_Bach_Air.mp3
|
41
41
|
|
42
42
|
どうすれば**AVAudioPlayer**でキャッシュフォルダにあるmp3ファイルを読み込むことができるでしょうか?
|
43
43
|
ご教授よろしくお願い致します。
|
4
説明文の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -15,6 +15,7 @@
|
|
15
15
|
if let _ = mngAudio {
|
16
16
|
self.finish()
|
17
17
|
}
|
18
|
+
// mp3ファイルのabsoluteString形式のパスのURLを取得
|
18
19
|
let absoluteStrURL = Const.getDownloadFileDestination(kind: .audio, alcSkuId: "********", target: "JS_Bach_Air.mp3")
|
19
20
|
// パスから"file://"を消す
|
20
21
|
let cashePath = absoluteStrURL.description.replacingOccurrences(of: "file://", with: "")
|
3
メソッドの修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -15,13 +15,11 @@
|
|
15
15
|
if let _ = mngAudio {
|
16
16
|
self.finish()
|
17
17
|
}
|
18
|
-
let fileName = url.lastPathComponent
|
19
18
|
let absoluteStrURL = Const.getDownloadFileDestination(kind: .audio, alcSkuId: "********", target: "JS_Bach_Air.mp3")
|
20
|
-
// パスから
|
19
|
+
// パスから"file://"を消す
|
21
|
-
|
20
|
+
let cashePath = absoluteStrURL.description.replacingOccurrences(of: "file://", with: "")
|
22
|
-
cashePath = cashePath.replacingOccurrences(of: "file://", with: "")
|
23
21
|
// ファイル名をつけて再度URL化
|
24
|
-
let chacheURL = URL(string: cashePath
|
22
|
+
let chacheURL = URL(string: cashePath)!
|
25
23
|
|
26
24
|
let ap = try AVAudioPlayer(contentsOf: chacheURL)
|
27
25
|
|
2
機密情報の隠蔽
title
CHANGED
File without changes
|
body
CHANGED
@@ -38,7 +38,7 @@
|
|
38
38
|
}
|
39
39
|
```
|
40
40
|
**chacheURL**を出力すると下記のようにパスが出ています。
|
41
|
-
/var/mobile/Containers/Data/Application/
|
41
|
+
/var/mobile/Containers/Data/Application/******-******-******-******-********/Library/Caches/********/audio/JS_Bach_Air.mp3
|
42
42
|
|
43
43
|
どうすれば**AVAudioPlayer**でキャッシュフォルダにあるmp3ファイルを読み込むことができるでしょうか?
|
44
44
|
ご教授よろしくお願い致します。
|
1
文字の大きさ修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
```Error
|
3
3
|
Error Domain=NSOSStatusErrorDomain Code=2003334207 "(null)"
|
4
4
|
```
|
5
|
-
しかし先に実行したcopyItemメソッドでは下記のように出ておりmp3ファイルが存在していることが確認できます。
|
5
|
+
しかし先に実行した**copyItem**メソッドでは下記のように出ておりmp3ファイルが存在していることが確認できます。
|
6
6
|
```Error
|
7
7
|
Error Domain=NSCocoaErrorDomain Code=516 "同じ名前の項目がすでに存在するため、“JS_Bach_Air.mp3”を“audio”にコピーできませんでした。" UserInfo={NSSourceFilePathErrorKey=/private/var/containers/Bundle/Application/*********-****-****-*****-**********/*****.app/assets/SE/JS_Bach_Air.mp3, NSUserStringVariant=(
|
8
8
|
Copy
|
9
9
|
), NSDestinationFilePath=/var/mobile/Containers/Data/Application/********-*****-*****-******-********/Library/Caches/********/audio/JS_Bach_Air.mp3, NSFilePath=/private/var/containers/Bundle/Application/********-*****-******-******-********/booco.app/assets/SE/JS_Bach_Air.mp3, NSUnderlyingError=0x283d21920 {Error Domain=NSPOSIXErrorDomain Code=17 "File exists"}}
|
10
10
|
```
|
11
|
-
メソッドはこちらになります。
|
11
|
+
**メソッド**はこちらになります。
|
12
12
|
```swift
|
13
13
|
func loadFile(url: URL, startTime: TimeInterval = 0) throws {
|
14
14
|
do {
|
@@ -37,8 +37,8 @@
|
|
37
37
|
}
|
38
38
|
}
|
39
39
|
```
|
40
|
-
chacheURLを出力すると下記のようにパスが出ています。
|
40
|
+
**chacheURL**を出力すると下記のようにパスが出ています。
|
41
41
|
/var/mobile/Containers/Data/Application/FDBCC21E-BACC-436E-8C52-B817E0F1C288/Library/Caches/9580586_free/audio/JS_Bach_Air.mp3
|
42
42
|
|
43
|
-
どうすればAVAudioPlayerでキャッシュフォルダにあるmp3ファイルを読み込むことができるでしょうか?
|
43
|
+
どうすれば**AVAudioPlayer**でキャッシュフォルダにあるmp3ファイルを読み込むことができるでしょうか?
|
44
44
|
ご教授よろしくお願い致します。
|