Trying to play sounds in console application VB.NET - vb.net

I want to play a sound file to play in my console application but the following doesn't work:
My.Computer.Audio.Play("[file path string]", AudioPlayMode.Background)
When hovering over "my computer" it brings brings up the error 'Computer' is not a member of 'JapaneseHelper.My'. And when hovering over Audio.PlayMode it says 'AudioPlayMode' is not declared. It may be inaccessible due to its protection level.
I have searched everywhere for this and can't find anything that shows me how to do it, I've only seen instructions for forms applications (When I try to copy what is done in the form app, it doesn't work either). I've tried a couple of "Imports" such as Import System.IO but they didn't fix the issue. I don't want to open a music player, I want it to be played in the background like My.Computer.Audio.Play should do. Is it because you can't do it for a console application maybe? However I don't understand why a console apps wouldn't be able to do it.

Did you make sure that your audio file is a .wav? From the Microsoft documentation it looks like you can only play .wav files. According to the documentation it should be possible to play audio files even in a console app.

Related

Does anyone know how do i get the list of all the applications installed in phone that can run audio files in react-native?

I want to create a functionality in react-native app such that on pressing a particular button, it should get me to the "open with" window, and that window should fetch me the list of all the installed applications in the phone which can run audio files. How can i get such list?
On a Android system, that "Open with" screen pops up when:
The user have more than one application that can play that specific audio format(Because it's not every app that can run every audio format).
The user did not set-up a default app to open the audio format.
So, You should just use a library like rn-fetch-blob to open the file for you, like as follow:
RNFetchBlob.android.actionViewIntent(fileLocation, mimeType)
And android will take care of picking the right app for you.
In case this answer does not satisfy you, you can get a list of apps using react-native-android-installed-apps-unblocking, but there's no information about wich ones can run an audio file, and maybe IOS will have some restrictions about what can be done, so your best option is to let the system do that for you!

VBA Windows Media Player in Access - WMP.Controls.play, "Object does not support ... "

My Access app will allow the user to select a video file and then play it. I set off with this code.
With WMP
.URL=VideoPath
End With
This works, but you have to press the play button on the player to see the video. I wanted it to play automatically. So i cast about for the appropriate method - hopeless.
The Auto List Members action just lists Control members. Searching on the Web is VERY FRUSTRATING, but as a result i tried adding
.Controls.play
That got "Object does not support ... ", as did
.CTLControls.Play
and even
.Play
There is no conventional VBA Help listing (Properties, Methods , Events) for using WMP in VBA. (if anyone knows better please tell). I have managed to implement automatic video play in VB.Net, and it is straightforward - but in VBA it seems impossible.
I may have bumped up against a limitation of using Windows Media Player in Access, but if you can solve my problem I would be most grateful

Create VB program to watch a website in Internet Explorer

Thanks for taking the time to assist me.
At work we use a 3rd party online chat system using internet explorer. Basically what happens is we initially follow a link, login, a pop up window comes up with the chat control page where we would see a notification for a new chat
The issue we have is no sound plays, and it's very easy to miss a chat.
In theory could I easily learn in VB how to watch that specific window of Internet Explorer for a change, then play a sound when a change in that window occurs until acknowledged?

Importing reference to Windows Media Player

After several hours I once managed to import the Windows Media Player.
Now I need to do it again, and I'm desperate because I don't see which file I need to import.
The reference in my old project looks like that:
The files I get offered while trying to refence them looks like this:
Does anybody perhaps know right away how to import the Windows Media Player?
I thought this was a valid question for stackoverflow because I'm stumbling over this issue for the second time now.
I got it:
Right-Click the toolbox, add "Windows Media Player" (COM component tab) and drag it onto a form.

Add more one button on Attach menu of Whatsapp

I've an idea to develop a modification to WhatsApp, for example now when I click attachment symbol it shows only 6 I want to add one more option to it. If it's possible let me know. I want to add more one button on Attach menu.
It is not clear what exactly you are asking.
You have an option to launch other applications from your app.
If you want to change the way a certain app looks, or behaves you have to write something similar to it for people to use, but you cannot change the original app (no one will let you)
Here you go! it's possible, as #Jef said in comments.
using documentation interaction controller.
https://www.whatsapp.com/faq/iphone/23559013
you need to work on how to hook into attachment menu.
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDocumentInteractionController_class/
There is an assumption in your question that these other apps are put there by the whatsApp developers, or by a third party who was somehow able to modify their code. I suspect that what is happening is that they (whatsApp) simply export a document/file of a certain type (UTI) If your application supports that same UTI it should appear here. So there is six buttons for you, on your phone, but another user might see a different number, it depends entirely what they have installed on their device.
CONCEPTUAL.. if you double click on a file on your computer then the file browser (OS) opens that file with some application or other. Perhaps it is a .doc file and the OS pushes that file to word or pages. Or it may be a .psd file and it gets pushed to photoshop. How does this happen? The OS has a registry (database) of applications for each file type, applications sign up on this when they install/update. If you right click on a file you see an 'open in..' option that lists all your applications which can handle that file type, this is the menu that you are wanting to get onto (for whatsApp's file type) imho.
So you need to
1 ascertain what file type (UTI) WhatsApp is exporting
2 declare support for that file type in your application (this is the bit which will be platform specific solution) (iOS docs https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/Articles/RegisteringtheFileTypesYourAppSupports.html#//apple_ref/doc/uid/TP40010411-SW1 )
**edit/addition
3. add the code to actually handle the file when your app receives it. On iOs this is in the appDelegate in
-(void) application: openURL: sourceApplication:annotation:
If the Whatsapp people have published an API then thats where you want to look. Good luck