How can I play MIDI files with VB.NET? I tried using WAV, but they are too big. Any help?
look at this article i used it before and it works.
http://www.codeproject.com/Articles/8506/Simple-VB-NET-MIDI-Wave-Play-Class
just copy paste that code in your project.
create variable which holds your midi and
call the play method.
you can also try this.(not sure about it.)
http://support.microsoft.com/kb/141756
Using MIDI files can be a good idea in regard to size, but IMO a horrible idea when it comes to actual sound (or lack there-of :) ). You can find users which do music too, and has a little better alternative set up or connected to their system, but to make users fire up their MIDI instruments and so forth to listen to a MIDI-track in a software can be a bad idea if unexpected.
Most users though are stuck with the built in wave synth from Microsoft which is a torture instrument (pun intended) and should probably not be used ;)
Why not consider compressing your wave data instead using MP3 or some other excellent compressor such as AAC, Ogg Vorbis ?
This will reduce the original data amount to at least 1/10 of the original size and unless you are providing a whole album, should be overcome-able.
You can find various ways to do this, from simple such as this one using the Media Player, or more low-level such as this one which decodes the MP3 file.
Also take a look at SlimDX.
Related
We'd like to build a small specialized clone of the ill-fated popcorn-time project, that is to say a node-webkit frontend for peerflix. The videos we'd like to play are mkv files that have embedded ASS subtitle tracks, and we can't seem to get the embedded subtitles to show up: while VLC nicely shows them, html5 video players in webkit-based things don't, not even in Google Chrome (so it's not a matter of Chromium's reduced codec support).
Now, I'm a bit out of our depths here, I don't really know much about these things, but it seems to me the media engine underneath webkit just ignores the ASS subtitle track here. Is it because it's ASS? Is it a matter of codecs somehow? Or is it, after all, a html5 thing? Now, the html5 video "living standard" mentions that "captions can be provided, either embedded in the video stream or as external files using the track element" - so the feature is at least planned, but I do realize that implementation is lacking. However, given that node-webkit uses ffmpeg as the underlying engine, it seems strange to me that the subtitles are not picked up at all.
Could someone more knowledgeable please advise us the problem? Also, is there anything we could do about it?
Extracting the subtitles beforehand is not an option, though I have been playing with the idea of extracting the subtitles on the fly, and feeding that stream back to the player - I had some modest success with this, and it looks like it could be done with some effort, but I'm really out of my depth here, and the whole idea is pretty contrived anyway.
However, I find it improbable that nobody has run into this problem before, hence this question: is there any way to show embedded (ASS) subtitle tracks in a streamed video in node-webkit?
Not sure if this would help but according to this page node-webkit doesn't ship with codec for patented media formats. They do have a few suggestions on the page, one of which is to compile your own node-webkit.
You could try using Popcorn Time's ffmpegsumo file which is what I used when I needed mp3 support and Chrome's version didn't work. Although, I don't know if that supports ASS subtitle format(considering its use, I would think it has to).
Note: I would have commented this answer but unfortunately I don't have commenting privileges yet. A couple of upvotes sure would be nice ;)
I want to know if there is a way in c++ or objective-c to get the BPM of a Mp3 file.
i found until now a source code for stuff that do it on wav files and not on mp3 file,
BPM (or beat) detection is a complicated algorithm that involves analyzing the sound stream in different ways. For this to happen, at least internally the MP3 must be decoded. Typically these are things you'd actually write in a language such as but not limited to C++ or Objective-C.
There are many libraries / pieces of code available that solve both problems, or in the case of beat detection: take a shot at it.
There's certainly no way to do BPM detection in the core C++ or Objective-C languages. You need to write the functionality yourself or take advantage of one of the many libraries that provide it.
If you can't find a suitable library that supports MP3 directly then you're going to have to decode to PCM first.
Are there any Open source APIs available for wav to midi conversion? You find many open source software, but I couldn't find APIs. Is there any way I can find them? Also are there any Open source APIs available for music transcription? (i.e. generating a digital version of a music sheet). Greatly appreciate any form of direction or assistance. Advance Thanks
Converting from wav to midi is a very difficult and error prone operation, not often done as far as I know, which will very often give poor results, so having an API to do that would be silly, though libraries may exist for it used in the Open Source software you mention. .wav files have no useful metadata that can help you get back to midi. It's much harder than speech to text to do well! (harmonics and noise matter). Will probably work OK for single instruments playing though, with strong fundamental frequencies that can be picked out with fourier transform.
For OCR of sheet music, I have found a piece of GPL'd software called Audiveris. This task isn't as hard as the previous thing, but is still a highly complex operation, probably requiring manual intervention to correct errors, that having a simple API for is pointless.
If you are making some Open Source software yourself, you can of course attempt to adapt swathes of code from these projects for whatever use you have in mind, though I doubt it would be worth the effort.
If any of the software you find has a command line interface to start a conversion, you could execute shell commands from your own software to make them do the required conversions automatically.
I understand that if I wanted to provide a QTMovie with data from an arbitrary source as it is needed I probably have to deal with the QTDataReference class, but unfortunately my experience with anything similar is limited to an audio data callback with Audio Buffers on the iPhone.
If I initialized the QTDataReference with some NSMutableData, how would I know when it needs more data and furthermore, how would I "clear" already played movie data and provide it again when the user seeks back (I want them to be able to)?
Basically the movie data I want to provide would in the end come from a set of files (which are really just one movie file split up), which become available sequentially during playback. This part is crucial.
Anybody who gets me going in the right direction can get beta access to the first Mac OS X Usenet movie streamer ;)
You likely can't do this using QTKit. Start with the QuickTime Overview and go from there.
The first idea that occurs to me is creating a QuickTime movie that directs QuickTime to look to the files you expect to download (or even to look directly to their remote URLs) for its media, then siccing QuickTime Player/QTMovieView on it and hoping that QuickTime's support for progressive download patches over any rough spots.
I'm due to work on a small application that captures audio from the Mac's Audio Queue and needs to save it to disk in some reasonable audio format.
Does anyone have a some decent sample code (Cocoa / Objective-C) that they can share?
I specifically need to capture the audio that is being passed to the Built-in Output device in order to record it. Any insights? The answers so far have been helpful, but have not helped me understand how the data going to the output can be captured, agnostic of the input source.
Working with audio in Mac OS X involves interfacing with Core Audio. For a quick overview, take a look at the Core Audio Overview.
You will need to interface with the AUHAL to perform input and output; a technical note exists detailing the steps required to do so. This code seems to usually be written in C++, as that is the procedure taken in the SimplePlayThru demo.
This doesn't cover the actual steps required to capture that audio input. However, these links should provide you with enough sample code to begin interfacing with your input device. I'll post more links in this answer if I happen across them.
Take a look at /Developer/Example/CoreAudio/Services/AudioFileTools. Specifically, look at afrecord.cpp. Admittedly, this is not Cocoa per se; Cocoa itself doesn't seem to have any specific capabilities for recording. If you'll want to interface with the C++ file there, you'll likely need to write some Objective C++ like in SimplePlayThru.
There is a good example code at Ulli Kusterers Github Repository
Cocoadev also has an article about that topic. The source code at the bottom of the page uses QuickTimes Sequence Grabber API. I would go with Core Audio.