w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Routing iPhone audio from bluetooth input to default output (not bluetooth)
You are talking about a speak through application? I did some R&D on this awhile back and ran into the issues you are talking about. At the present it seems that this is not possible on iOS. You cannot configure your iPhone to record from the microphone and route that audio recording out to the speaker for instant playback. The best you can do is record it, stop it and send it. Recording and playing through the speaker cannot be configured in an audio session. Spending time researching this (like I did) will be upsetting. It has nothing to do with core audio hacking it has to do with what is allowed by the system

Categories : IOS

Play audio from a direct link
Let's take a look at the HTMLMediaElement DOM interface and Media Events var audio = new Audio(downloadUrl); audio.addEventListener('ended', function () { audio.currentTime = 0; // seek to position 0 when ended playing /* // alternatively, not sure about compatibility audio.fastSeek(0); */ }); If you wanted it to loop rather than be playable again, set loop to true instead.

Categories : Javascript

Input not read in Python for Linux
You've deliberately chosen a getch implementation that avoids queueing and only grabs the latest character. You can service input faster by moving the # Do Something # part to a background thread, or use an event-loop-like implementation where you queue up all available characters before trying to process the first one off the queue, etc. But none of that will guarantee you get all characters. If you want to allow characters to queue up to make sure you don't miss any, just… don't use an implementation that's designed not to let them queue up. If you don't need getch to timeout after 2 seconds, you can just do this by just not calling select. That also means you don't need TCSADRAIN. Also, instead of calling setraw, try turning off just the flags you care about. Disabling ICANON is

Categories : Python

Capturing keyboard input in python as a daemon in Linux
As usual for linux, there are a variety of different interfaces that can do different parts of what you want on different systems. I'm guessing what you want is a way to talk to the /dev/input/* interfaces. You can do that just by opening them and ioctling and reading from them, but you probably don't want to do that. evdev looks like a nice wrapper around both /dev/input/* and the uinput APIs. Of you could grab pykeylogger and hack up the source to do what you want.

Categories : Python

Create output file names based on input file name with autonumbers shell script linux
VAR="INPUTFILENAME" # One solution this does not use the VAR: touch INPUTFILENAME{1,2,3,4,5,6,7,8,9,10} # Another for i in `seq 1 20` ; do touch "${VAR}${i}" done And there are several other ways.

Categories : Linux

Python input and output threading
It's absolutely possible. If you have a function that prints output (let's call it print_output) you can start it up in a different thread using the threading module: >>> import threading >>> my_thread = threading.Thread(target=print_output) >>> my_thread.start() You should now start getting your output. You can then run the input bit on the main thread. You could also run it in a new thread, but there are some advantages to running input in the main thread.

Categories : Python

Connect:Direct From Linux server to Unix
mount the target server shared folder in the source server folder (or vice versa) and copy the files there using cp command. For filesystem mount : http://linux.about.com/od/commands/l/blcmdl8_mount.htm Remote mounting

Categories : Linux

Is there a way to do input and output of packets in the same loop in Tornado (Python)?
I just wrote up an example that almost exactly matches what you are trying to do here. In the example a TCP socket is used, but you can trivially modify it to use UDP. Also, you probably want to use IOStream instead of SSLIOStream. The relevant files are consumer.py and stream_reader.py. You can also move the stream reader instance outside of the web socket handler and make it a global instance that is always listening, if that is your preference.

Categories : Python

How to re-direct standard output as it comes from Stream
Got it: String^ s; //Console::WriteLine(s); //proc->WaitForExit(); while(s=stream->ReadLine()) { Console::WriteLine(s); } This works

Categories : C++

Search for keyword appearances and direct output to file
This is enough: grep -nr "Digital Currency" --exclude "*.pdf" --exclude wordcount-digital-currency.txt > wordcount-digital-currency.txt if you want to exclude the matching line, use cut: grep -nr "Digital Currency" --exclude "*.pdf" | cut -d: -f1,2 > wordcount-digital-currency.txt from the grep man-page: -l, --files-with-matches Suppress normal output; instead print the name of each input file from which output would normally have been printed. The scanning will stop on the first match. (-l is specified by POSIX.)

Categories : Unix

How to pipe input to python line by line from linux program?
I do not quite understand why you want to use commandline arguments instead of simply reading from standard input. Python has a simple idiom for iterating over lines at stdin: import sys for line in sys.stdin: sys.stdout.write(line) My usage example: $ echo -e "first line second line" | python python_iterate_stdin.py first line second line Your usage example: $ echo "days go by and still" | python python_iterate_stdin.py days go by and still

Categories : Python

Using "$**" to direct file input within a Makefile
I suspect that this doesn't actually do what you want. $** is not a single construct; it is the special Makefile variable $* followed immediately by the shell-glob wildcard *. The line is going to be rewritten twice: first, by Make, to something like !../path/to/tools/unifdef --opt1 --opt2 foo* > ../path/to/target/foo* and then, by /bin/sh, to something like !../path/to/tools/unifdef --opt1 --opt2 foo.c foo1.c foo2.c fooquux.c > ../path/to/target/foo* and only then executed. You didn't quote any of the context, so I can't be any more specific than that. Here's why I think this can't be right, though: Unless maybe you set .RECIPEPREFIX, which is a feature I had never heard of before now, the ! at the beginning of the command doesn't make any sense and should be causin

Categories : C

Industry Standard code PHP and JSON data via ajax or direct output
Instead of echoing out a long concatenated string, the standard php templating tags are prefered: eg: <?php //do stuff ?> or <?= //stuff to be echoed ?> Doing this turns your first code block into: <?php foreach($items as $item): ?> <div class="well"> <div class="row-fluid"> <div class="span3"> <img src="<?=$item[0]?>"> <ul id="info"> <li>Author : <?=$item[1]?></li> <li>Release Date: <?=$item[2]?></li> </ul> </div> <div class="span9"> <h3><?=$item[3]?> by <?=$item[1]?></h3> <p><?=$item[4]?></p> </div>

Categories : PHP

Qt MediaPlayer nothing played in linux. Windows only audio heard
Try: QMediaPlayer *player = new QMediaPlayer; player->setMedia(QUrl::fromLocalFile("big_buck_bunny_480p_h264.mov")); QVideoWidget *videoWidget = new QVideoWidget; w.setCentralWidget(videoWidget); // if w is a QMainWindow player->setVideoOutput(videoWidget); player->play(); Alternatively, if you want to know how to do it with QGraphicsVideoItem: QGraphicsView *graphicsView = new QGraphicsView(this); w.setCentralWidget(graphicsView); // w = QMainWindow QGraphicsScene *scene = new QGraphicsScene(this); QMediaPlayer *player = new QMediaPlayer(this); QGraphicsVideoItem *item = new QGraphicsVideoItem; graphicsView->setScene(scene); player->setVideoOutput(item); graphicsView->scene()->addItem(it

Categories : C++

Extra Input fields in AmazonS3 Direct Upload POST Form
I worked around the problem by sending the title attribute through the URL. In my RouteConfig file I added a new route: routes.MapRoute( name: "Transcode", url: "{controller}/{action}/{title}/{id}", defaults: new { controller = "Videos", action = "Transcode", id = UrlParameter.Optional } ); and then in the Transcode action I added a title parameter. Then finally the value I passed to the redirect URL attribute was: " http://dev.area.local/Videos/Transcode/title"

Categories : Asp Net Mvc

How to open my apps audio player to play audio after clicking an audio link which is present in email?
Well you will need to register your own URL scheme for your app. Read Apples Implementing Custom URL Schemes on how to do this. But you can not make iOS prompt to install you app, since the OS does not know about you app. What you could do is always open a website which will try to open your by its URL sheme and it this fails present the use a webpage that offers them to download it.

Categories : Iphone

Record Android Audio Output
Seems to be currently there is no way to achieve this. I have read this article and it suggests to recompile the Android source code with some changes. A Method to Capture Android System Audio Anyway most of the time this is not a feasible solution. This is another question related to this : android get device overall audio output in pcm

Categories : Android

JavaFx Audio Output Selection
For years it has been a very unfortunate limitation of the Java implementation for OS X, being BTW particular for that platform, that "Java Sound Audio Engine" is the only programmatically available output audio line. In consequence, whatever you send to this line, i.e. out from any java application that you make, will always be routed to what has been set as the default output in the OS X, typically internal speakers. So the JSAE is just Java terminology for "default audio out". To our understanding - sadly - this is still the case with latest release. Why unfortunate ? Because it effectively disables even humble audio routing. We are working with these matters on a daily basis, and it calls for all sorts of added complexity. There are work arounds, but via third party apps as SoundFlowe

Categories : Java

Reading audio stream to output device
A more or less easy way is to take advantage of Stereo Mix device, where available. This way you have an audio capture device, which makes you available device audio output mixed down. You can read from this device as if it were a real audio input device such as Line In, or a microphone, using standard and well documented APIs or audio libraries. Other options are more sophisticated and require both hooking into system and deeper understanding of the internals: you either hook audio APIs to intercept what applications send to audio outputs, or you install a virtual audio device the applications use and you have the data available from.

Categories : C++

Android - Getting Current Audio/Video Output
Starting with API level 16 (Jellybean) there's the MediaRouter API which allows you to get some information about the current audio/video routing. To get routing info you'd use the getSelectedRoute method, with the ROUTE_TYPE_LIVE_AUDIO or ROUTE_TYPE_LIVE_VIDEO flag. This gives you a RouteInfo object, through which you can get the name of the route using the getName method. For example: MediaRouter mr = (MediaRouter)getSystemService(Context.MEDIA_ROUTER_SERVICE); RouteInfo ri = mr.getSelectedRoute(MediaRouter.ROUTE_TYPE_LIVE_AUDIO); if ("HDMI".equals(ri.getName().toString()) { // do something... }

Categories : Android

Audio.js audio player how to stop downloading audio file when started
To prevent an <audio> element from downloading on page load just set the preload attribute to "none". As for stopping the download after it has begun, you should be able to do that by simply removing the <audio> element from the page. The plugin you mentioned may also require you to run an additional command to clean up anything it added to the page.

Categories : HTML

Take the output of "select" in hive as the input of Hadoop jar input file
It seems that you are gonna run two rounds of Mapreduce: 1st is a Hive query and 2nd is MapReduce stream. As far as I am concerned, to use multi-round Mapreduce jobs, we always need to write/read to/from hdfs between the rounds. That's why MapReduce is always called batch operation. So, the answer to your question is NO.

Categories : Hadoop

Python direct exceptions in def to stdout
did you try this.. exeptions = [] def first(): try: "Talking Business Here" except IOError, e: sys.stdout.write(e) exceptions.append(e) else: "Make a deal" also you can try to append all the exceptions in a list and then if len(exceptions) >0: "send me a mail"

Categories : Python

Python Try Except Direct Error To Different File
First off you want something more like: numbers = [1,2,3, '4', '5', 6, 7] for number in numbers: print int(number) * 2 Secondly, could you state you problem clearly I have no idea what files your dealing with etc.

Categories : Python

html5 web audio api save the output after applying filters on server
Check out https://github.com/mattdiamond/Recorderjs. The API is pretty straight-forward, but leave a comment if you have any questions and I can help you out.

Categories : Ruby On Rails

Sending sine wave values from array to audio output
You have configured the sample format SND_PCM_FORMAT_U8, but the actuall buffer contains 32-bit floating-point samples. Use SND_PCM_FORMAT_FLOAT, or define the buffer as an array of unsigned char. Furthermore, you have confused the loop to initialize the buffer and the loop to play the data, and many bytes/frames numbers, and fs is wrong; you need to use something like this: for (i = 0; i < BUFFER_LEN; i++) buffer [i] = sin(2*M_PI*f/48000*i); // sine wave value generation for (i = 0; i < 10 * 48000 / BUFFER_LEN; i++) { // 10 seconds frames = snd_pcm_writei(handle, buffer, BUFFER_LEN); if (frames < 0) frames = snd_pcm_recover(handle, frames, 0); if (frames < 0) { printf("snd_pcm_writei failed: %s ", snd_strerror(frames)); break;

Categories : C

Linux terminal input: reading user input from terminal truncating lines at 4095 character limit
I do not have a workaround for you, but I can answer question 2. In linux PIPE_BUF is set to 4096 (in limits.h) If you do a write of more than 4096 to a pipe it will be truncated. From /usr/include/linux/limits.h: #ifndef _LINUX_LIMITS_H #define _LINUX_LIMITS_H #define NR_OPEN 1024 #define NGROUPS_MAX 65536 /* supplemental group IDs are available */ #define ARG_MAX 131072 /* # bytes of args + environ for exec() */ #define LINK_MAX 127 /* # links a file may have */ #define MAX_CANON 255 /* size of the canonical input queue */ #define MAX_INPUT 255 /* size of the type-ahead buffer */ #define NAME_MAX 255 /* # chars in a file name */ #define PATH_MAX 4096 /* # chars in a path name including nul */ #define PIPE_BUF

Categories : Linux

How to create an event# device for a virtual input device (/dev/input/js3) in linux kernel module?
Here is an example, you can use 1. class_create to create the class specified for the device, 2. device_create to create the device node 3. cdev_init to initialize and 4. cdev_add to add the device to the /dev list For example you can refer the below link :Create a device node in kernel module

Categories : Linux

Python Scrapy - Direct spider to specific Pipeline
ITEM_PIPELINES setting is defined globally for all spiders in the project during the engine start. It cannot be changed per spider on the fly. Here's what you can do. Define what spiders should be processed via the pipeline in the pipeline itself. Skip/continue processing items returned by spiders in the process_item method of your pipeline, e.g.: def process_item(self, item, spider): if spider.name not in ['spider1', 'spider2']: return item # process item Also see: Is there any method to using seperate scrapy pipeline for each spider? Hope that helps.

Categories : Python

Using VoiceProcessingIO audio unit subtype instead of RemoteIO causes unwanted drop in output volume
I do not think it is possible to account for the loss of output in volume. According to Recording volume drop switching between RemoteIO and VPIO "There is no API that controls this gain (or in your case drop) level, everything is internally setup by the OS depending on Audio Session Category (for example VPIO is expected to be used with PlayAndRecord always) and which IO unit has been setup." It would also help if you said what iOS you were testing on because they have different drops in output volume.

Categories : IOS

Detect human voice from audio file input
The way to process the input is to use a specialised library which removes noise. For example, http://audacity.sourceforge.net, does noise removal. So long as you have characterised the main types of noise, you should have only speech remaining. It would be worthwhile collecting sampling data before the capture from the user, and after the user ended the capture, as this would provide at-the-time samples of noise in the environment. This is useful if each user faces unique background noise challenges.

Categories : Android

Converting WAV file audio input into plain ASCII characters
ASCII characters like Az09 are only a portion of the ASCII Table. WAV files like any other file is stored and accessed in bytes. 1 byte has 256 different values. Therefore one can't simply convert bytes into Az09 since there are not enough Az09 characters. You'll have to find a library which opens WAV files and creates the wave format for you. In relation to the wave's intensity and length, a chain of Az or Az09 characters can be produced. I believe you're trying to convert the wave to a series of notes. That's possible too, using the same approach.

Categories : C++

Process/record multiple audio input streams in Java
Java Sound API isn't the easiest to learn, but it is reasonably low-level and powerful. I've mixed more 10 tracks before, using .wav inputs, custom-made "Clips" (reading sound files from memory) and procedural FM synthesis, using software I was able to write as a Java programmer with intermediate skills and some basic knowledge about sound (but NOT an engineering degree level of sound knowledge). I've not tried recording multiple lines, or recording at all for that matter except one "toy" program that takes an input wave and stores it for varispeed playback. That really wasn't much more complex than just uploading a .wav, so I don't know the answers to t your question. I do anticipate it will be worth a look at the TargetDataLine interface as a key tool. There are various sound engines w

Categories : Java

Catch Python script output in PHP and avoid double output
You can try with exec function. It also performs a command execution but, at diference fo system, doesn't output the content to standard output. The only drawback is that the return is an array of every line in the stadard output (not a string, like system. You can also try with proc_open, that allows you redirect the output to an arbitrary pipe.

Categories : PHP

Linux: No output from a program in a .sh script
It could be sending output to stderr. To account for this possibility, try wine Blockland.exe ptlaaxobimwroe -dedicated -port 30000 2>&1 >>consoleLog.txt The 2>&1 bit redirects stderr (file descriptor 2) to stdout (file descriptor 1). Then it redirects stdout (which includes stderr output now) to your log file.

Categories : Linux

how to redirect system output to my gui app (qt, linux)?
If you launch the script via QProcess, you can get the output by connecting to the readyRead signal. Then it's just a matter of calling any of the read functions to get the data and then displaying it on any type of widget you want, such as a QTextEdit which has an append function for adding text. Something like this: - // Assuming QTextEdit textEdit has been created and this is in a class // with a slot called updateText() QProcess* proc = new QProcess; connect(proc, SIGNAL(readyRead()), this, SLOT(updateText())); proc->start("pathToScript"); ... // updateText in a class that stored a pointer to the QProcess, proc void ClassName::updateText() { QString appendText(proc->readAll()); textEdit.append(appendText); } Now, every time the script produces text, your updateText

Categories : Linux

Linux-About sorting shell output
Using awk to count the occurrences of field three and sort to order the output: $ awk '{a[$3]++}END{for(k in a)print a[k],k}' file | sort -n 1 install 1 ./linux 2 cd 6 make 6 yum So filter by command: $ awk '/cd|yum|install/{a[$3]++}END{for(k in a)print a[k],k}' file | sort -n 1 install 2 cd 6 yum To stop partial matches such as grep in egrep use word boundaries < and > so the filter would be /<cd>|<yum>|<install>/

Categories : Linux

Best way to pipe output of Linux sort
I believe sort will read all data in memory, so I'm not sure you will won anything but you can use shell=True in subprocess and use pipeline >>> subprocess.check_output("ls", shell = True) '1 a a.cpp A.java a.php erase_no_module.cpp erase_no_module.cpp~ WeatherSTADFork.cpp ' >>> subprocess.check_output("ls | grep j", shell = True) 'A.java ' Warning Invoking the system shell with shell=True can be a security hazard if combined with untrusted input. See the warning under Frequently Used Arguments for details.

Categories : Python

Linux storing top output to a file
The top cli command behaves different to what you might be used to from other utilities. This is because it does not work in a typical filter like way reading from stdin and writing to stdout. Instead it emulates a terminal. This means that you cannot simply redirect its output, because there is no output written to standard out. Check the man page (which you should always do...). You will notice the -b flag which changes that behaviour. This will allow you to do what you try.

Categories : Linux

Output Redirection in linux to a file by a variable
You cannot read a file and in the meanwhile redirect your output to it. What you can do is to use -i parameter in sed, that updates the file: sed -i 's/def version = ".*"/def version = "'$version'"/' $file You can see an example in http://stackoverflow.com/a/16901328/1983854 I posted yesterday.

Categories : Linux



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.