Using javax.sound.midi i've managed to open my midi device up for outputting a .midi file in the past but the issue is i need to be able to pickup the midievent in it's raw form as in "3C40"/"903C40".
I'm able to find documentation on opening transmitters/receivers/sequencers but no code examples using these to output to say a string as the raw data from the midi device example of which is my yamaha ypt-240
digital keyboard.
Basically the reasoning behind why i want this raw data is to make some simple keybindings that would be triggered by said raw data from the midi device almost like a stream deck or using software that allows this.
The ShortMessage seems like the way to go but again can't find any code using it the way i would like to.
Every example is mididevice||file.midi -> synth||mididevice
I need a way to intercept that input java is getting from the device...
please help lol
Related
I need to implement a DAB+ player. Therefore i ordered a DVBT stick which can also retreive DAB and DAB+ signals.
My simplified approach looks like this:
Read input stream, split for audio and further information, pass the audio part to the audio library and process the further information for displaying in a GUI.
So my first question is: how do i get the input stream delivered by the device?
Can i simply create a new file object and call something like getInputStream()?
Second question: Is anyone familiar with DAB decoding? How do i split the input stream for audio and other information? How can i synchronize it? Which audio library should i use?
Thanks a lot
I'm new on this world of BlackBerry and the thing is that i have a byte array of certain file that can be anything (picture, pdf, txt ...) and need to be shown. How can i execute applications related with the specific extention? In other words how can i invoke an application and give it the byte array to be displayed as the original file?
I also have the extention or file type.
I have tried to open the file using browsers but it always return timeout and that's not the idea.
Here is something like my question but it has not a final response. I'm developing for BlackBerry Curve.
I have never used it, but I think the appropriate API for this is the Content Handler API, most commonly referred to as CHAPI I think. Look for documentation of javax.microedition.content. Here is a link that will take you to the ContentHandler class.
I suggest that you look for the chapidemo sample for more information. It should have come with your tooling, if not, here it is on github: chapidemo sample.
Is there any API in Java for MPEG-TS?
I need API, by which I can get parsed TS packets with information and all other information like PAT, PMT, CAT etc etc... with which I can develop my TS multiplexer application by selecting few programs from received TS.
Thanks
i think you can use stream reader class and parse it into mpeg-ts. by reader i mean u need to read and store the binary from stream and output in into different format u desire.
try http://project-x.sourceforge.net/
Copied from their homepage:
European digital radio & television uses the DVB standard to broadcast its data. Project-X gives you a look behind the transmissions and tries its best to handle & repair many stream types and shows what went wrong on reception. It's not meant for a regular use but for test and learning conditions.
I'm trying to write a console game using java, and when you hold down a key, I want it to move your character constantly.
This means I need key press and key release events, because there is a delay when you hold down a key before it starts typing that same letter over and over.
I've already put the terminal into raw mode using stty, but I don't seem to be getting key release events.
This answer seems to indicate that I can indeed get those events from STDIN: https://stackoverflow.com/a/1598436/2404047
What I actually receive when in raw mode is a single byte for most keys, but in some cases, like the arrow keys, I get multiple bytes.
Is there a way I can get key press and release events through STDIN, or is a console game like this simply not doable?
This is your missunderstanding. You cannot get events from console using pure java.
Possible solutions are:
Get events using native utility, redirect them to file/pipe and read them into java code from that file
Use JNI/JNA directly
Use library that already wraps JNI and expose Java API for this purpose. Take a look on Charva that provides you API you need and even much more.
I need to split mpeg4 video stream (actually from android video camera) to send it through RTP.
The specification is little large for quick reference.
I wonder if there any example/open source code for mpeg4 packetization?
Thanks for any help !
Mpeg4 file format is also called ISO/IEC 14496-14. Google it any you will find specifications.
However, what you are trying to do (RTP publisher) will be hard for the following reasons:
Mpeg4 has header at the end of the file. Which means header will be written out only when video stream is finished. Since you want to do real time video streaming you will need to guess where audio and video packets start/end. This will not be the same on all Android devices as they might use different video sizes and codec parameters. So your code will be device-dependent and you'll need to support and test many different devices.
Some devices do not flush video data to file in regular intervals. Some only flush once a minute or so. This will break your real-time stream.
There is no example code. I know because I looked. There are a few companies that do something similar, but mainly they skip RTP. Instead they progressively upload the file to their own server and then implement video/audio stream "chopping" and then insert it into their video/transcoder backend. I used to work for one of those companies and that's how we did it. AFAIK competition took similar approaches. The upside is that all complexity is on server an you do not need to update clients when something breaks or new devices arrive on the market.