Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1036167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:39:34+00:00 2026-05-16T14:39:34+00:00

I am developing a mac application that involves audio playback. I would like to

  • 0

I am developing a mac application that involves audio playback.
I would like to pause other audio players when our playback starts.

how can I
1) detect that itunes is running
2) detect that itunes is currently playing
3) pause itunes
4) resume itunes when I am done

also:
5) Is the a way to pause other types of media playback as well? audio and video in the in the browser for example?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:39:35+00:00Added an answer on May 16, 2026 at 2:39 pm

    You can do that with the following code which is using ScriptingBridge:

    #import "iTunes.h"
    #import "Cocoa/Cocoa.h"
    
    int main()
    {
      iTunesApplication* iTunes = [SBApplication applicationWithBundleIdentifier:@"com.apple.iTunes"];
    
      // check if iTunes is running (Q1)
      if ([iTunes isRunning])
      {
        // pause iTunes if it is currently playing (Q2 and Q3)
        if (iTunesEPlSPlaying == [iTunes playerState])
          [iTunes playpause];
    
        // do your stuff
    
        // start playing again (Q4)
        [iTunes playpause];
      }
      return 0;
    }
    

    The file iTunes.h is generated by running sdef /Applications/iTunes.app | sdp -fh --basename iTunes from a commandline. The error unknown type name "tdta" can be ignored.

    You also need to add ScriptingBridge.framework to the linked frameworks.

    Here is also a link to the ScriptingBridge documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 513k
  • Answers 513k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I found that it works if you change the webview… May 16, 2026 at 5:47 pm
  • Editorial Team
    Editorial Team added an answer Most users don't really care about flash, really. You can… May 16, 2026 at 5:47 pm
  • Editorial Team
    Editorial Team added an answer You can load UIImage with absolute filepath by following API.… May 16, 2026 at 5:47 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am developing an application that query to the server. In my Mac, I
The company I work for is developing an ASP.NET application that is used by
When developing on BlackBerry or iOS, you can deploy your application just by dropping
I'm developing a program using Windows 7. There are WCF services (soap, rest) that
I have been developing a small Java utility that uses two frameworks: Encog and
I'm currently involved in a project developing applications primarily for Linux (Fedora 10). However,
I am a perl developer that has never went into the client side programming
A line in this answer , Get used to using the Mac on its
At the moment I am learning Objective-C 2. I'm aware that it's used heavily
I'm new to developing in iOS and successfully ran through a tutorial on how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.