Sponsored Content
Operating Systems OS X (Apple) Applescript application call problem... Post 302915550 by wisecracker on Wednesday 3rd of September 2014 05:21:37 PM
Old 09-03-2014
Applescript application call problem...

Hi all...

I am trying to create a shell project purely for this Macbook Pro.
I do NOT want to use SOX as the sampling _source_ but Quicktime
instead, the idea being that NO third party installs will be needed.

The code below works fine except the commented out Applescript line
does not do what it says on the tin...

I want to sample 1 second snatches of a signal without the small audio
recording image appearing on screen. In other words a pseudo-embedded
mode...

Does anyone know if or how this can be done?
If not then I can live with it during each snatch...

Ignore the lines below the asterisks they are for my test purposes only
and be aware of wordwrapping...

Any help would be greatly appreciated...

TIA.
Code:
#!/bin/bash
# qt.sh
cd /Users/barrywalker/Desktop/Audio
rm *.aifc >/dev/null 2>&1
sample()
{
osascript << APPLESCRIPT
	tell application "QuickTime Player"
		# set visible of process "QuickTime Player" to false
		set sample to (new audio recording)
		tell sample
			delay 1.5
			start
			delay 1.5
			stop
		end tell
		quit
	end tell
APPLESCRIPT
wait
}
sample
# *********************************************************
afconvert -f 'WAVE' -c 1 -d UI8@8000 "/Users/barrywalker/Desktop/Audio/Audio Recording.aifc" waveform.wav
ls -l waveform.wav
afplay -d waveform.wav
dd if=waveform.wav of=waveform.raw skip=4096 bs=1 count=8000
/Users/barrywalker/Downloads/sox-14.4.0/play -v 0.5 -r 8000 -b 8 -c 1 -e unsigned-integer /Users/barrywalker/Desktop/Audio/waveform.raw


Last edited by wisecracker; 09-04-2014 at 03:28 AM.. Reason: Now solved...
 

10 More Discussions You Might Find Interesting

1. Programming

Problem in system call

Dear Friends, I write a c program to list the directories recursively. For this I write a function called my_readdir to read the content of directory. For this I use read system call it returns -1, then I use readdir system call it gives comment terminated error or segmentation... (1 Reply)
Discussion started by: spmlingam
1 Replies

2. Solaris

Application Loading problem

I install a software xchm for opening chm files. I install software and also its required libraries. But when i start it; no GUI appears. Application got halt. Process name also appears in process list when i run top command. Appliation continously using cpu but no GUI appears. Please tell me... (7 Replies)
Discussion started by: mansoorulhaq
7 Replies

3. UNIX for Advanced & Expert Users

kernel call problem

hi all I want to make a kernel call which takes as input an integer x and prints 2*x Anyone who knows how could i do that? (1 Reply)
Discussion started by: sasa
1 Replies

4. AIX

problem in msgctl() system call

Hi, i am using IBM P6 server and OS is AIX 5.3. my code is written in c/pro C. i am facing problem in msgctl() system call.The variables msg_qbytes and msg_cbytes are used to store total no of bytes and current no of bytes in a QUEUE,but it is showing me as ZERO though data are there... (0 Replies)
Discussion started by: ajaysahoo
0 Replies

5. Shell Programming and Scripting

Recursive function call problem

This is shell script I have made to lists out directory contents and filenames for any given directory (without using ls command). There is some problem in dirfunc function call which I have marked 1 is not working. Can anybody suggest what is the problem there and how should I correct it. ... (2 Replies)
Discussion started by: netresearch
2 Replies

6. Linux

system call problem

hi, where can I find the detail information about the syscall in binary instructions of linux/mips. for example, in linux/mips: li v0, 4140 syscall it's a syacall of "lseek" , but how can I find that which registers will be used in this syscall , and the meaning of the arguments in the... (2 Replies)
Discussion started by: zerocool_08
2 Replies

7. Programming

C++ application halts at popen system call

Hi All, My application gets hang at the popen statement in Soalris 5.8. While debugging I found that it halts at _lwp_sema_wait. After googling I have added /usr/lib/lwp in the LD_LIBRARY_PATH and now it halts at lwp_park. Please help me what I need to do to solve this issue. The application runs... (6 Replies)
Discussion started by: Amiya Rath
6 Replies

8. Programming

socket system call can not succedd right after application crash.

hello all, I have developed a server application in C for ulinux kernel 2.6.It works very fine; creating a socket, binding it to a port, listening for incoming sockets and accepting them ,all finish without any error. But there is a problem regarding application crash.After an intentionally... (1 Reply)
Discussion started by: Sedighzadeh
1 Replies

9. Shell Programming and Scripting

awk , function call problem

#!/bin/bash awk ' function ad(t,r){ return (t+r); } BEGIN{ print ad(5,3); } { print ad(5,3); } ' Doesn't print anything for the last print ad(5,3); (6 Replies)
Discussion started by: cola
6 Replies

10. Programming

Problem with lseek call.

The following code: int fd; if (fd = open("mem", O_RDONLY) == -1) return 1; if (lseek(fd, 0, SEEK_SET) == -1) { char *buf = malloc(512); buf = strerror(errno); printf("%s\n", buf); return 1; } always returns with "illegal seek"... (2 Replies)
Discussion started by: Sir_Tomasz
2 Replies
AURECORD(1)						      General Commands Manual						       AURECORD(1)

NAME
aurecord - record a sound file from a Network Audio System server SYNOPSIS
aurecord [-audio servername] [-file format] [-data format] [-rate sample rate] [-mode input mode] [-gain input gain] [-time seconds] [-com- ment comment] [-?] filename DESCRIPTION
The aurecord program can be used to record audio data from a Network Audio System server into a file. The recording will continue until either the specified time has elapsed or aurecord receives a SIGINT or SIGTERM signal. OPTIONS
The following options may be used with the aurecord program: -audio servername The Network Audio System server from which the file should be recorded. -file format The file format to be used for the recorded audio data. The -? option will display a list of valid file formats. The default file format is Sun/NeXT. -data format The data format to be used for the recorded audio data. The -? option will display a list of valid data formats. Note that each file format may only support selected data formats. The default data format is 8-bit uLAW. -rate sample rate The sampling rate (in hertz) for the recording. The default rate is 8000 Hz. -mode input mode Some Network Audio System servers may have different input amplification modes for microphone input versus line level input. This option allows the amplification mode to be specified. The two modes available are "mic" for microphone input and "line" for line level input. The default mode is "mic". -gain input gain The input gain level in percent. The default is 75%. -time seconds The time, in seconds, for the recording. If this option is not used, aurecord will record until a SIGINT or SIGTERM signal is received. -comment comment A comment to be stored in the data file. -? Displays a usage message and a list of supported file and data formats. SEE ALSO
nas(1) COPYRIGHT
Copyright 1993, 1994 Network Computing Devices, Inc. AUTHOR
Greg Renda, Network Computing Devices, Inc. 1.9.3 AURECORD(1)
All times are GMT -4. The time now is 04:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy