Integrate music and other audio content into your apps.

Posts under Audio tag

185 results found
Sort by:
Post not yet marked as solved
35 Views

Issue finding available auv3 plugins on ios

Hi, I'm attempting to call audioComponentFindNext() from an iOS application (built with juce) to get a list of all available plugins. I've got an issue whereby the function is only returning the generic system plugins and missing any the 3rd party installed plugins. This issue is currently found when called from within another auv3 plugin though I have also seen it from within a normal iOS app. (Ran on iPad air 4), it the moment is working fine from an iOS app. I've tried setting microphone access and inter-app audio capabilities as I saw it suggested on similar forum posts though it has not solved my problem. Any advice would be very appreciated Thanks
Asked
by Wlpjam.
Last updated
.
Post not yet marked as solved
7.4k Views

tvOS14 Audio Output Sources Missing

tvOS14 has no option to choose an output source so No Airplay to homepods. Has the Option moved or been removed from this version? I see nothing about it in the release notes
Asked
by pacman.
Last updated
.
Post marked as solved
211 Views

How can add songs to a playlist or create a new playlist from my APP?

Hi, I would like to be able to create a playlist from my app or add songs to an existing selected playlist in the user music library, How can I do that ? Is there an API in MusicKit to do that? The Shazam app is doing something similar with the My Shazam Songs playlist... Thanks
Asked
by aleroot.
Last updated
.
Post not yet marked as solved
40 Views

Music won't play when screen locks

Hi, I had my app developed and have found that when the iPhone locks screensaver it stops playing the track and doesn't recognise it has a sound track playing. Is there something my developer needs to put in or is it an IOS security issues? Love any recommendations please.
Asked
by Sootsy.
Last updated
.
Post not yet marked as solved
85 Views

How do you do a POST to a user's playlist so as to add tracks?

Trying to do what I can do pretty easily with a standard post request in a JS app, but now with Swift, and I'm struggling. I've tried with MusicRequestItem, but that fails, so I went with this and it responds with a 400. func addTracksToAppleMusicPlaylist(targetPlaylistId: String, tracksToSave: [Song]) async throws -> Void {     let tracks = tracksToSave.compactMap{         AppleMusicPlaylistPostRequest(id: $0.id, type: "songs")     }     do {         print("Saving tracks to Apple Music Playlist: \(targetPlaylistId)")         let tokens = try await self.getAppleMusicTokens()         if let url = URL(string: "https://api.music.apple.com/v1/me/library/playlists/\(targetPlaylistId)/tracks") {             var request = URLRequest(url: url)             request.httpMethod = "POST"             request.addValue("Bearer \(tokens.devToken)", forHTTPHeaderField: "Authorization")             request.addValue("\(tokens.userToken)", forHTTPHeaderField: "Music-User-Token")             request.setValue("application/json; charset=utf-8", forHTTPHeaderField: "Content-Type")             let encoder = JSONEncoder()             let data = try encoder.encode(tracks)             request.httpBody = data             let session = URLSession(configuration: .default)             let task = session.dataTask(with: request) {(data, response, error) in                 if error == nil {                     if let httpResponse = response as? HTTPURLResponse {                         print("statusCode: \(httpResponse.statusCode)")                         print("response: \(httpResponse)")                     }                 } else {                     print("Error saving tracks to playlist \(String(describing: error))")                 }             }             task.resume()         } else {             print("Bad URL!")         }     } catch {         print("Error Saving Tracks to Playlist", error)         throw error     } }
Asked Last updated
.
Post not yet marked as solved
101 Views

iOS 14.7 Bluetooth Connectivity

I upgraded from iOS 14.6 to 14.7 as I had encountered issues playing lossless music offline, and there was a fix available with the 14.7 release. Come to find out that 14.7 has a much bigger issue - my music does NOT play anymore regardless of lossless or standard songs. I have tried restarting the devices, tried connecting to multiple Bluetooth headsets, both of which were playing music before. Any help to resolve this would be appreciated.
Asked
by hrao.
Last updated
.
Post marked as solved
292 Views

MusicCatalogSearchRequest without AppleID/Account on iPhone

Hi, I'm currently working on a little music app PoC. I want to search the albums in the Apple Music Catalog which will done via a MusicCatalogSearchRequest: let musicAuthorizationStatus = await MusicAuthorization.request() print(musicAuthorizationStatus) // Issue a catalog search request for albums matching search term. var searchRequest = MusicCatalogSearchRequest(term: searchTerm, types: [Album.self]) searchRequest.limit = 5 let searchResponse = try? await searchRequest.response() print(searchResponse?.albums) I would expect to get a valid search response but it is nil instead. This is the console log when no AppleID is configured on my test device: 2021-06-15 23:07:19.083194+0200 ShareFi[1519:727518] [Entitlements] MSVEntitlementUtilities - Process ShareFi PID[1519] - Group: com.apple.private.tcc.allow - Entitlement: kTCCServiceMediaLibrary - Entitled: NO - Error: (null) .authorized 2021-06-15 23:07:19.130446+0200 ShareFi[1519:727542] [DataRequesting] Failed retrieving MusicKit tokens: Error Domain=ICErrorDomain Code=-8102 "Failed to fetch user token." UserInfo={NSDebugDescription=Failed to fetch user token., NSUnderlyingError=0x2825d8750 {Error Domain=ICErrorDomain Code=-7401 "No active account." UserInfo={NSDebugDescription=No active account.}}}. Throwing .userTokenRequestFailed. 2021-06-15 23:07:19.131133+0200 ShareFi[1519:727542] [DataRequesting] Failed retrieving tokens for MusicDataRequest.Context(url: https://api.music.apple.com/v1/catalog/us/search?term=Earfood&types=albums&omit%5Bresource%5D=autos&limit=5). Error = .userTokenRequestFailed. When I use a sandbox account the error is still a .userTokenRequestFailed but the message says something like: Privacy terms must be accepted first. The Apple Music API seems to require a "Developer Token" but no "User Token" for search requests?! So my questions are: Is it possible to make MusicCatalogSearchRequests without having an AppleID configured? What resources can a user without a active Apple Music subscription interact with? Best regards :) Julian
Asked
by juka1205.
Last updated
.
Post not yet marked as solved
224 Views

MusicKit Album Release Data

When printing out an Album, the release date is included: Album(   id: "1566393640",   title: "Aquatic - Single",   artistName: "Nora En Pure",   genreNames: [     "Dance",     "Music"   ],   releaseDate: "2021-06-04",   isCompilation: false,   upc: "7640130765399" ) But it is not mentioned as an instance property here and I cannot identify any way to access it in my project. How can I go about getting access to this attribute via MusicKit? Thanks! :)
Asked Last updated
.
Post marked as solved
1.3k Views

macOS Big Sur - macbook speaker sound breaking when I have my Xcode simulator on

I updated by macbook air to Big Sur. Whenever I have my xcode simulator running or turned on, my macbook speaker sound breaks up. If I turn off my simulator, the sound comes out fine. Is this a known bug?
Asked Last updated
.
Post not yet marked as solved
104 Views

ShazamKit during AVCaptureSession - Recognize audio while using camera

Hi, I want to implement ShazamKit in my project. But I have some problems. I use AVCaptureSession to take photos in my app and I'm unable to use ShazamKit. I tried to use three different ways Use an AVAudioEngine during my AVCaptureSession But I didn't obtain any result from Shazam. Try to use ShazamKit after stopping my AvCaptureSession but this causes some problems, and some crashes. Try to use the buffer of my AVCaptureSession to catch audio directly without use AVAudioEngine. This is the code that I use with AVAudioEngine: try! audioSession.setActive(true, options: .notifyOthersOnDeactivation)                 let inputNode = self.audioEngine.inputNode                 let recordingFormat = inputNode.outputFormat(forBus: 0)                                 let audioFormat = recordingFormat //AVAudioFormat(standardFormatWithSampleRate: self.audioEngine.inputNode.outputFormat(forBus: 0).sampleRate,                     //                            channels: 1)                                  inputNode.installTap(onBus: 0, bufferSize: 1024, format: audioFormat) { (buffer: AVAudioPCMBuffer, when: AVAudioTime) in                     try! self.signatureGenerator.append(buffer, at: nil)                                          self.session.matchStreamingBuffer(buffer, at: nil)                 }                              self.audioEngine.prepare()                 try! self.audioEngine.start() I can choose two ways to do this, use AVCaptureSession output to pass it to ShazamKit or use an AVAudioSession after the stop of AVCaptureSession. So I have two questions: Can I use a CMSampleBufferRef from AVCaptureSession buffer in a SHSession? And if the answer is yes how? How can I prevent this error if I want to use an AVAudioSession after I stopped my AVCaptureSession? [aurioc]            AURemoteIO.cpp:1117  failed: -10851 (enable 1, outf< 2 ch,      0 Hz, Float32, deinterleaved> inf< 2 ch,      0 Hz, Float32, deinterleaved>) [avae]            AVAEInternal.h:76    required condition is false: [AVAEGraphNode.mm:834:CreateRecordingTap: (IsFormatSampleRateAndChannelCountValid(format))] *** Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'required condition is false: IsFormatSampleRateAndChannelCountValid(format)' Thanks
Asked
by RedSun.
Last updated
.
Post not yet marked as solved
98 Views

how to inform part users with HLS content steering

I am confused with the example in the video of HLS content steering introduction.The example says that 100% clients from China to playback through the intial CN cdn from content steering server. And then the CN cdn is overloaded;My question is that how to select which part of 70% clients keep the previous CDN, and how to select which part of 30% clients switch into JP cdn? And how to inform the different part of clients to keep or switch new cdn?? I thought that all clients will get the new content steering information with new priority cdn ,and all of clients will switch into new one. So how to control the numbers of clients to do 70% clients keep priority or 30% clients change priority??
Asked
by Barrios.
Last updated
.
Post not yet marked as solved
97 Views

CarPlay Audio entitlement

Hi, My account was approved for the com.apple.developer.playable-content entitlement, but now it's deprecated and I want to switch to the new one com.apple.developer.carplay-audio. I have some problems making the transition, do I need to submit a new request to Apple for the new entitlement? Thanks.
Asked
by angarov.
Last updated
.
Post not yet marked as solved
57 Views

MPMusicPlayer continues in background, incorrectly?

I have written a small app that runs on iOS 15.   I am trying to get some user-selected song to play in the background.   The code below does that fine. However, the documentation says that the music should stop when the app is placed in the background.   But I am not seeing this; the music continues to play.   (The content of the system music player is not effected by this app.)  Am I missing something here?     func setPickedSong(_ song:MPMediaItem) {         let player = MPMusicPlayerController.applicationQueuePlayer         player.setQueue(with: MPMediaItemCollection(items: [song]))         player.repeatMode = .all         player.prepareToPlay { error in             if (error != nil) {                 print("ERROR: \(error!)")                 return             }             player.play()         }
Asked Last updated
.
Post not yet marked as solved
868 Views

Play html audio in wkwebview will report error: Required client entitlement is missing

An error is reported when playing h5 audio or video elements in wkwebview: Error acquiring assertion: Error Domain=RBSAssertionErrorDomain Code=3 "Required client entitlement is missing" UserInfo={RBSAssertionAttribute=RBSDomainAttribute| domain:"com.apple.webkit" name:"MediaPlayback" sourceEnvironment:"(null)", NSLocalizedFailureReason=Required client entitlement is missing} Then the performance of the webview will become very poor. There is an audio element and a button button in my HTML file. Click the button to play audio. body button onclick="handleClick()"PLAY/button audio id="audio" src="https://ac-dev.oss-cn-hangzhou.aliyuncs.com/test-2022-music.mp3"/audio script function handleClick() { document.getElementById("audio").play(); } /script /body Create a wkwebview to load the html file in my demo APP. class ViewController: UIViewController , WKUIDelegate{ var webView: WKWebView! override func loadView() { let config = WKWebViewConfiguration() config.preferences.javaScriptEnabled = true config.allowsInlineMediaPlayback = true webView = WKWebView(frame: .zero, configuration: config) //.zero webView.uiDelegate = self view = webView } override func viewDidLoad() { super.viewDidLoad() let myURL = URL(string: "https://ac-dev.oss-cn-hangzhou.aliyuncs.com/test-2022-py.html") let myRequest = URLRequest(url: myURL!) webView.load(myRequest) } } Click the button in the HTML to play the audio, and you can see the error report on the xcode. iPadN[2133:855729] [assertion] Error acquiring assertion: Error Domain=RBSAssertionErrorDomain Code=3 "Required client entitlement is missing" UserInfo={RBSAssertionAttribute=RBSDomainAttribute| domain:"com.apple.webkit" name:"MediaPlayback" sourceEnvironment:"(null)", NSLocalizedFailureReason=Required client entitlement is missing} To sum up, this error will appear when playing audio or video in HTML. Then the app performance will drop a lot, and the interactive response will be very slow.
Asked
by pengyong.
Last updated
.