I have an application which plays a midi sound.
The application works fine without sandboxing, and plays the sound it is supposed to play, but I cannot here the sound when I enable sandboxing.
I need to upload the application to mac app store, but i cannot do it, because i cannot get sound.
I also cannot open the file dialog box, when I enable sandboxing.
Is there any way I can at least enable the sound in the app?
As Petesh said in above comments, I had to add some more entries in the entitlements file,
the link which was given by him above, contained following. You add them to your entitlement file, and everything will start working like a charm.
This one allows your application to access the microphone.
com.apple.security.device.microphone
This allows talking to the MIDI Server which coordinates all the Midi functionality across applications.
com.apple.security.temporary-exception.mach-lookup.global-name
This allows talking to audio components which are not itself sandboxed.
com.apple.security.temporary-exception.audio-unit-host
They worked for me.
Related
Link to the bug report on 'Feedback Hub'
An audio endpoint device, from here on referred to as 'endpoint', is a physical or virtual audio output or input device.
With the Windows 10 April Update 1803 the long overdue 'App volume and device preferences' have been introduced. These settings allow more control over audio stream management as it is now possible to set different endpoints for different applications, no matter whether that particular application comes with an endpoint selection or not.
However, there is an issue where the audio of a program, whose endpoint is non-default, is streamed through the default endpoint (or not at all) after it has been closed and launched again, although the endpoint is displayed correctly in the settings:
As far as I know the issue can be recreated on a Windows 10 machine (version 1803 or higher) with any virtual or physical endpoint and an affected program. I used 'VLC Media Player' in this example (disregarding the fact that it comes with an endpoint selection) as it is well known and widely accessible, which should make it easier to recreate the issue.
What I'm searching for...
... is a programmatically solution to switch between endpoints, which ideally can be launched in form of a script to set the correct endpoint with an application launch.
For my purpose it would be enough to have to adjust the device instance path manually, as the device would be always the same, but I'm not going to complain about a solution which retrieves the device instance path from the registry, too.
Defined endpoints and the device instance path of the device they are using can be retrieved from the subkeys of the key HKEY_USERS\# YOUR SID #\Software\Microsoft\Multimedia\Audio\DefaultEndpoint. I don't know how windows generates the name of the subkeys or where they can be found. If I had to take a wild guess, I'd say these are Application IDs (feel free to correct me if I'm wrong).
The device instance path itself can be found in the Device Manager (under 'Audio inputs and outputs' double click the desired device, navigate to the tab 'Details' and select 'Device instance path' from the 'Property' drop-down menu).
Additionally the entry about Audio Endpoint Devices and Stream Management in the Microsoft Docs might be helpful, but that is way above my head.
A possible but impractical workaround...
... would be, to manually set another endpoint for the application and switch back to desired endpoint at every launch of said application (as shown above).
But not just takes this at least 10 seconds at each and every launch, you might even forget to do this as the audio might just get streamed through the default endpoint *¹.
The alternative to the latter is, that no audio will be streamed at all *² or in some cases it actually works *³.
*¹ e.g.: VLC Media Player, Tom Clancy's Rainbow Six Siege (although the audio will be streamed correctly during the splash screens)
*² e.g.: Call of Duty 4: Modern Warfare, Call of Duty: Modern Warfare 2, Call of Duty: Modern Warfare 3
*³ e.g.: Window Media Player, Microsoft Edge, Firefox
Observations
VLC Media Player comes with an endpoint selection, but so does TeamSpeak 3 and, unlike VLC, it skips the Windows settings completely.
Call of Duty not streaming any audio most likely is connected to the engine as I didn't encounter any other application doing something similar.
Windows Media Player, Microsoft Edge and Firefox are the only programs (I tested so far) which work fine. They have no endpoint selection (I'd know of) and will use the correct endpoint after closing and launching it again. It should be noted, however, that Firefox and Microsoft Edge will show multiple instances in the "App volume and device preferences" when adjusting the endpoint.
Disclaimer
I already tried two 3rd party softwares: 'Audio Router', which didn't work at all and 'CheVolume', which doesn't solve the issue and constantly crashes while doing so.
This question is based on one I asked over at Super User (here), where I didn't get an answer I was able to work with due to my lack of knowledge regarding actual programming (I'm only somewhat familiar with Batch and PowerShell). I'm well aware that neither Stack Overflow nor Super User are script writing services, however, the issue is not being fixed with the Windows 10 October Update 1809 and I see this as a problem which is affecting not just me and with that would be helpful for multiple people after me. Feel free to write a comment or propose an edit if you see this differently.
I'm also not sure whether the tags 'audio-streaming' and 'endpoint' should be used in this context, please propose an edit if they shouldn't or you can think of any better.
Edit - 05/11/18
Using the 3rd party software 'EarTrumpet' I was able to overcome the issue with the 'Call of Duty' games (no audio at all after restarting), however, 'VLC Media Player' would not restart after I assigned a non-default endpoint with 'EarTrumpet' until I closed 'EarTrumpet' again and the issue with 'Tom Clancy's Rainbow Six Siege' remains the same.
Edit - 18/01/19
Added link to a bug report I created on the 'Feedback Hub' 2 month ago.
Edit - 20/01/19
After doing some testing again it should be noted that having 'EarTrumpet' run in the background will keep a non-default endpoint for 'VLC Media Player' across restarts, however, 'VLC Media Player' will only (reliably) restart when the non-default endpoint was set in the 'App volume and device preferences'.
I do not have any solution regarding a programming language to handle such events.
But I can recommend EarTrumpet app to handle this change more quickly https://www.theverge.com/2018/6/13/17457778/eartrumpet-windows-10-audio-app
(Windows store: https://www.microsoft.com/en-us/p/eartrumpet/9nblggh516xp?ranMID=24542&ranEAID=nOD%2FrLJHOac&ranSiteID=nOD_rLJHOac-hUn6PgKuMKwQLdrzRqnPTA&epi=nOD_rLJHOac-hUn6PgKuMKwQLdrzRqnPTA&irgwc=1&OCID=AID681541_aff_7593_1243925&tduid=%28ir__qwqlg6jd0jba3y9hpnbvikaite2xk6kuyv9udtr100%29%287593%29%281243925%29%28nOD_rLJHOac-hUn6PgKuMKwQLdrzRqnPTA%29%28%29&irclickid=_qwqlg6jd0jba3y9hpnbvikaite2xk6kuyv9udtr100&activetab=pivot:overviewtab )
I will update the answer if I find a easy way to script/program a change of output on each app.
I was wondering if it is possible to capture a copy of the audio output in Qt so I can process it. Here they said it's possible to monitor the playback, but I think it's only possible if you use a self made music player, which I don't want. I want to capture the signal from no matter where it is player (youtube, spotify, facebook, etc.). Is there a way to analyze this data with Qt? Is it possible to set my output of my soundcard as a QMediaSource?
Thank you in advance.
In general, no, that isn't possible, simply because your process (and therefore the Qt library that is loaded into your process) does not have access to that information. (I believe this lack of access is deliberate; since if it did have access like that, there might be security and/or privacy implications, i.e. app A could use it to spy on the audio output of app B, etc)
There may be an OS-specific mechanism that you can use; for example, if you are running your program under MacOS/X, you can install the SoundFlower audio driver that can function as a loopback device, allowing programs to read audio from its "audio input" that was previously routed to its "audio output". But without that kind of external support, it's not currently possible to record the computer's audio output via Qt.
OK, first I shall point that I am completely new to Windows Apps Development, which is good, since I am trying to develop a Windows Store App for PC to use a PrimeSense Scanner connected via USB. I have asked a more specific question about this here.
This time I have a more generic question, which is more related to Windows Store app development. I am using VS2013 Express and compiling for Win32.
When I compile my application for VS2012 and run it as an execcutable file, I can connect to the scanner perfectly. But I can't do the same with VS2013 and running it as a Store app.
I know the device is connected and the drivers are updated and all dlls file placed in the Widnows System 32 directory.
I have also added all Capabilities to the App Manifest and also added the following Device Capability
<m2:DeviceCapability Name="usb">
<!--OSRFX2 Device-->
<m2:Device Id="vidpid:1d27 0609">
<m2:Function Type="classId:ff * *" />
<m2:Function Type="name:vendorSpecific" />
</m2:Device>
</m2:DeviceCapability>
The vid and pid, obviously match the corresponding codes of the device.
One of the errors I recieve when trying to conenct to the scanner using OpenNI is:
Could not open to "\\?\usb#vid_1d27&pid_0609&mi_00#7&1601586a&0&0000#{c3b5f022-5a42-1980-1909-ea72095601b1}" USB Device not found
This error is quite frustrating since I know the device is connected. So I tend to think that there is some level os specificity on the Windows Store App side of the game that is not enabling my to connect to the device. As I said, I am compiling for Win32.
Is there a chance that the drivers will not work for a Windows Store App. Is there some extra stuff I should do inside the Windows Store App logic that I am not doing and that is necessary to connect the USB device? I am sorry, but I am completely new to Windows Store App development.
Thank you.
You can't do that from metro apps.
You typically create a handle to that usb device by calling CreateFile with that object mananger path as the file to 'create'. CreateFile is not allowed in metro apps - "desktop apps only" - and its 'replacement', CreateFile2, specifically doesn't allow opening object manager objects.
Furthermore, the documentation for CreateFile2 states that in metro apps this function can only open files and directories (and not things like pipes, mailslots, consoles, etc.).
See also this post on social.msdn
Unless I missed something, I don't think this is possible.
I would like, from a native Windows application using C++, to receive video/audio data sent from a browser located in a remote location. It seems like WebRTC is the way to go for this.
Most information I find is about how to interact with the browser to write WebRTC apps, but it may case the data would be received by my C++ app. Is it correct that I would need to use the WebRTC Native Code package for this, which is described as being 'for browser developers'? Document is located here: http://www.webrtc.org/webrtc-native-code-package
And what if I want to send video/audio data that I generate (ie not directly coming from a webcam and microphone), would I be able to send it to the remote location browser?
Any sample code out there which does something like I'm trying to accomplish?
The wording in that link is a bit misleading. They intend people that are developing browsers to use the native code, and advise those that are developing "applications" in a browser to use the WebRTC API.
I have worked with their native code for over a year to develop an Android application that is capable of performing audio and / or video calls between other Android devices and to browsers. So, I a pretty sure that it is completely possible to to take their native code and create a Windows application (especially since they have example code that does that for Linux and Mac -- look at peerconnection client and peerconnection server for this). You might have to write and re-write code to get it to work on Windows.
As for as data that you generate. In the Android project that I worked with, we didn't rely on the Android device / system to provide us with video, we captured and sent that out our selves using the "LibJingle" / WebRTC libraries. So, I know that that is possible, as long as you provide the libraries with video data in the correct format. I would imagine that one would be able to do the same with audio, but we never fiddled with that, so I cannot say for sure.
And as for example code, I can only suggest Luke Weber's gitbug repositories. Although it is for Android, it might be of some help to look at how he interfaces with the two libraries. Probably the better code to look at is the peerconnection client stuff that comes in the "LibJingle" second of the native code. [edit]: That is located in /talk/examples/peerconection/client/ .
If you get lost from my use of "LibJingle", that will show you when I started working with all of this code. Sometime around July of 2013 they migrated "LibJingle" into the WebRTC "talk" folder. From everything that I have seen, they are the same thing, just with the location and named changed.
When I connect the iPod (or iPhone) to the Windows PC,
it look like an USB drive, but I can't open a file on it because I can't know the correct file path.
I was also unable to drop the file to my application because the drag source does not have CF_HDROP.
Some applications can open a file on iPod, but it was a copy on the local temp folder.
screenshot http://img862.imageshack.us/img862/5396/ipodx.png
My question is ..
How can I directly (programmatically) open and read the picture file on iPod?
If I double click on it (or right click and select Preview menu),
it launches Windows Photo Viewer -- it is not my default picture viewer.
Can I change the file (.PNG) association to other application?
What's the viewer application's requirement to be a default viewer for files on ipod?
Applications that do that use Picture Transfer Protocol (PTP). On Windows Microsoft implements many interfaces as part of Windows Image Acquisition (WIA). Read more here: http://msdn.microsoft.com/en-us/library/ms630344(v=VS.85).aspx
http://support.microsoft.com/kb/307859 or manually edit registry at HKEY_CLASSES_ROOT\.png
Try the iPhoneBrowser program. It should give you a fair idea of the path.
From everything I've read I don't think Apple gives you access to the file system on the iPhone / iTouch / iPad; they want you to use iTunes to transfer files back and forth. I believe the Android and Windows Phone environments have similar restrictions. (If you "jailbreak" or "root" your device that's obviously a different story, which is why many such utilities explicitly state they only work on rooted devices.)
In part, this is a security precaution: if it were possible to directly access the file system on the mobile device it would be that much easier for someone to plant malware on your phone or PDA.
For this reason, updates to the various mobile OSes frequently include changes to (1) make jailbreaking more difficult and/or (2) close the loopholes that allow software like the iPhoneBrowser to work.
Some of the portable music players that use (Windows) Media Player have similar limitations. For example, I had a Sansa m100 (I think) where I could just drag files to the device and the playlist would automatically get updated; on at least some of the newer models (eg the c200) you have to use Media Player to download content. Which to me is annoying since there doesn't seem to be a way to use Media Player to delete content from the device.
There probably are APIs to do this sort of thing, but I would guess they're somewhat specific to the platform you're using -- ie I don't think you're going to be able to just use CreateFile() or something like that.