Explore the integration of media technologies within your app. Discuss working with audio, video, camera, and other media functionalities.

Post

Replies

Boosts

Views

Activity

No output for long time
I found that didOutputSampleBuffer would not be called for long time when the screen is no change. It sometimes make me confused for if there something wrong. In my design, it will change to other screen shot method, such as CGWindowListCreateImage, when long time no data. But this is not what I expected. I set the minimumFrameInterval to 30 but it seems no work. [config setMinimumFrameInterval:CMTimeMake(1, 30)]; Is there any settings that can let me get a didOutputSampleBuffer, even given a CMSampleBufferRef with status SCFrameStatusIdle, called atlest one time per second? Which would make me think it works fine without any exception.
0
0
490
Jan ’24
Music User Token into Python via MusicKit JS or API?
Hi! I've been working on a project in python that pulls in a bunch of my personal apple music playback history and library, etc. I can't find a single good/functional example on how to pull the Music User Token via the android method or MusicKit JS (web) - I've spent a lot of hours on this today, and no permutation of existing examples/documentation has worked. Any guidance would be much appreciated!! If you have a web app that pulls the music user token, I just need help understanding how to get to the token itself. Thank you!
2
0
780
Jan ’24
Apple Music user token expiration
I'm writing an Android app that uses the Apple MusicKit SDK for Android. I am trying to understand how to handle the Apple Music user token, once I got it from authentication flow. I don't know when the token will expire, it is not a regular jwt token, so I cannot check the expiration date. And I don't want to run the auth flow on every app run, it will be annoying for the users. Any guidance on how to handle and invalidate apple music user tokens?
0
0
486
Jan ’24
Compilation error in Apple MusicKit SDK for Android
I have downloaded the official Apple MusicKit SDK for Android and integrated 2 AARs it has in my app (musickitauth-release-1.1.2.aar and mediaplayback-release-1.1.1.aar). When I try to build my app I'm getting an error: Manifest merger failed : android:exported needs to be explicitly specified for element <activity#com.apple.android.sdk.authentication.SDKUriHandlerActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. Which makes sense, since when I look into the AAR's AndroidManifest.xml I see that this is missing in SDKUriHandlerActivity. Can this be fixed?
1
0
450
Jan ’24
ApplicationMusicPlayer on macOS doesn’t work with AirPlay (AVRoutePickerView)
I’m using the new ApplicationMusicPlayer support on macOS 14 and playing items from my Apple Music library. I wanted to play this music from my app to an AirPlay destination so i added an AVRoutePickerView. However, selecting any destination via this view doesn’t make a difference to the playback. It continues to play on my mac speakers no matter which airplay destination i choose. Also submitted as FB13521393.
0
1
663
Jan ’24
MusicKit: Error when performing a MusicLibrarySectionedRequest using some MusicLibraryRequestable types
When making a library sectioned request, some MusicLibraryRequestable types used result in an MusicKit.MusicLibraryRequestError being thrown. When a Playlist is used as the MusicLibrarySectionRequestable type, no other MusicLibraryRequestable type than Track can be used for the request. For others, Artist & Genre cannot be used. Is there a way to work around this issue? The (seemingly) equivalent functionality in MediaPlayer (MPMediaQuery and MPMediaGrouping) was very consistent and reliable. Full error info: MusicKit.MusicLibraryRequestError.invalidType, The operation couldn’t be completed. (MusicKit.MusicLibraryRequestError error 1.) Device and OS: iPhone 13 Pro, iOS 17.2.1
0
0
320
Jan ’24
Seeking Guidance on Creating a Playlist Navigation App with OAuth Authentication
Hello Apple Community, First, I'm asking this on the holidays, so happy holidays. Now I have some "fun coding time" and can do it because I have some holiday time. I'm new to this area and would greatly appreciate your expertise and guidance. Have mercy. I'm attempting to develop a simple application on my Mac OS to browse my playlists. However, I've encountered a few roadblocks that I struggle to navigate. I understand I need to implement two-factor authentication to access my playlists, for which an OAuth setup is required. This involves obtaining an Apple ID and a service ID and dealing with other complex elements. One particular challenge I'm facing is with the redirect URI in the OAuth process. It seems that it needs to be a valid domain, and I'm unsure if using a local server address like https://localhost:5000 would work. My goal is to create a basic Flask application that can interact with Apple's web authentication system, but I'm uncertain about the feasibility of this approach, given the domain restrictions. I would appreciate any advice or step-by-step guidance on the following points. What would be the simplest way to create an application (Swift, Python, or JavaScript) that can authenticate and enable browsing through my playlists? Any insights, tips, or examples you could share would be immensely helpful. I am eager to learn and look forward to your valuable suggestions. Anything step-by-step would be great, but I like to dream. Thank you so much for your time and assistance.
1
0
555
Dec ’23
Requesting Assistance with MusicKit Authorization and Account Monitor Registration Issue
2 Days and I am frustrated. I"ve crossed my T's and dotted my I's. Using musickit Error Attempted to register account monitor for types client is not authorized to access: {( "com.apple.account.iTunesStore" )} Offending Code var request = MusicLibraryRequest<MusicKit.Playlist>() request.sort(by: .lastPlayedDate, ascending: false) let response = try await request.response() Verified Custom IOS Target Properities Privacy - Media Library Usage Description Correct Bundle Identifier Checkbox AppServcies/Music Kit for App ID Please help! 2 days of racking my brain, just can't get passed error MusicKit does ask me to authorize Other code works let request = MusicRecentlyPlayedContainerRequest() let response = try await request.response() See Image
2
2
874
Dec ’23
MusicKit API issues
I'm trying to test the MusicMarathon and MusicAlbums tutorial/demo apps for MusicKit and half the endpoints do not work. As an example the MusicMarathon call to MusicRecentlyPlayedContainerRequest() just returns a 401. Everything I've done seems correct. I've got a fully authorized session and I have all the development keys successfully setup. Also it's not all API's as I can access the users Library, Just none of the recommendation and search endpoints seems to be working correctly. I'm running iOS 17.2 and Xcode 15.1 I'm pretty certain this is easily repeatable by just running the demo applications from the MusicKit documentation,
0
0
377
Dec ’23
Need to write a program to embed album art in purchased Apple Music
I recently downloaded Apple Music for for Windows 10 and started a new music library. Then I downloaded all my purchased music albums to my computer. However, the album art is not embedded in any of the m4a files. It is stored in a separate artwork folder. I have Visual Studio 2022 and was wondering how I might go about accessing the Apple Music app using the API. I want the script to go through all my purchased music and take the album art from the artwork folder and embed it in the purchased m4a files. I found some other programs/scripts online but they are all for iTunes or for Mac. None of the old scripts will work because they don’t recognize the new Apple Music for Windows music library. I can’t go back to iTunes because Apple removed all the music options from the iTunes for Windows app. Any ideas on how to get started writing the app/script would be greatly appreciated. Can I download something from Apple to make it easy to access the API in Visual Studio 2022 for Windows?
0
0
422
Dec ’23
SDK or API limitations/timeouts on 'unattended' use of an Apple Music-interface app
Hi, my team is developing an iOS app which connects to Apple Music (currently most of it is via API, but some tests have been done with MusicKit). In a separate development, we were using a service which competes with A.M., and when their (web) API is used, if the user doesn't interact with the app somehow (scrolling, buttons, etc), the connection will timeout after 30 seconds and force them to reconnect. So, questions I have are: Is there any timeout regarding stopping tracks in Apple Music or does the connection to the A.M. app stay active? If the connection drops on iOS as well, is there any limitation regarding streaming A.M. content via API (aka are there licensing issues as well?)
0
0
400
Dec ’23
ScreenCaptureKit volume is dependent on audio device as of macOS 14.2
Hello, I develop an application called MiniMeters and am using ScreenCaptureKit to get the desktop audio on macOS. As of macOS 14.2, a few users began noticing that the volume of the incoming audio differed depending on the audio device connected. One user's Apogee Symphony Desktop is trimmed -14dB, another user's UAD Apollo Twin is -14dB as well, my MOTU M4 is -6dB, and my MacBook Pro's internal speakers show 0dB. This does not change with changing the output volume on the interface (obviously), nor digitally in the system. I cannot seem to find anything documenting this change. It also affects other applications that use ScreenCaptureKit such as OBS. Does anyone have any idea what that could correlate to so I could potentially compensate? Thanks.
1
1
538
Dec ’23
Music volumen down bluetooth after iOS 17.2
I am detecting problems with the volume level with the Bluetooth connection after the iOS 17.2 update. Before this problem persisted on the iPhone 11 and the iPhone 15 Pro, after the 17.2 update it seems that the problem was fixed on the iPhone 11 but still It persists on the iPhone 15 Pro. I have never had problems with the volume level in my car, but something Apple has changed that continues to affect it. How can it be corrected? Thank you very much for your support. I did a test with the same song and the same volume level (maximum volume on the smartphone and volume 12 on my Suzuki Swift) and these were the decibels results obtained. The Iphone 11 and 15 Pro has updated to iOS 17.2
0
0
508
Dec ’23
mediaPlaybackError callback never fires
Greetings Fellow Humans, My player uses the v3 musickit-js library. I am trying to handle situations where a user tries to play explicit content in my player with an account that has content restrictions enabled. I don't see a mechanism to know if the toggle is set in the account. The only mechanism I see is to respond to a CONTENT_RESTRICTED error as handled by the callback to the function I provide as a callback to the mediaPlaybackError event. I have attached many callbacks (like bufferedProgressDidChange) and those all work, but this one never fires. music.addEventListener("mediaPlaybackError", onPlaybackError); Or music.addEventListener(MusicKit.Events.mediaPlaybackError, onPlaybackError); My onPlaybackError function, at least for debugging purposes, is: function onPlaybackError(e) { console.log("onPlaybackError"); console.log(e); } There are so many error conditions that are meant to be handled in this way but the callback never happens. Am I missing something? Why doesn't this callback fire? Thanks!
1
0
576
Dec ’23