Able to change volume
This commit is contained in:
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
#decrease Audio
|
||||||
|
|
||||||
|
currentVolume=`cat currentVolume.txt`
|
||||||
|
|
||||||
|
newVolume=`./decreaseVolume.out $currentVolume`
|
||||||
|
|
||||||
|
amixer -c 1 set DAC0 $newVolume > /dev/null
|
||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
#raiseAudio
|
||||||
|
|
||||||
|
currentVolume=`cat currentVolume.txt`
|
||||||
|
|
||||||
|
newVolume=`./increaseVolume.out $currentVolume`
|
||||||
|
|
||||||
|
amixer -c 1 set DAC0 $newVolume > /dev/null
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <ios>
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
std::fstream sssssssssliper;
|
||||||
|
sssssssssliper.open("currentVolume.txt", std::ios::out);
|
||||||
|
|
||||||
|
const unsigned short DECREMENT = 15;
|
||||||
|
unsigned short currentVolume = atoi(*(argv + 1));
|
||||||
|
unsigned short newVolume = currentVolume - DECREMENT;
|
||||||
|
|
||||||
|
sssssssssliper << newVolume;
|
||||||
|
sssssssssliper.close();
|
||||||
|
|
||||||
|
std::cout << newVolume << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#Volume Dump
|
||||||
|
|
||||||
|
|
||||||
|
amixer -c 1 get DAC0 > audio.txt
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <ios>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
std::fstream readAudio;
|
||||||
|
unsigned short count;
|
||||||
|
unsigned short volume;
|
||||||
|
|
||||||
|
readAudio.open("audio.txt", std::ios::in);
|
||||||
|
|
||||||
|
while (!readAudio.eof())
|
||||||
|
{
|
||||||
|
std::string data;
|
||||||
|
readAudio >> data;
|
||||||
|
|
||||||
|
//std::cout << data << " ";
|
||||||
|
|
||||||
|
if (data.compare("Playback") == 0)
|
||||||
|
{
|
||||||
|
++count;
|
||||||
|
std::cout << "Count incremented" << std::endl;
|
||||||
|
}
|
||||||
|
if (count == 3)
|
||||||
|
{
|
||||||
|
readAudio >> data;
|
||||||
|
volume = atoi(data.c_str());
|
||||||
|
std::cout << volume << " value of audio" << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
std::cout << std::endl;
|
||||||
|
|
||||||
|
readAudio.close();
|
||||||
|
readAudio.open("currentVolume.txt", std::ios::out);
|
||||||
|
|
||||||
|
readAudio << volume;
|
||||||
|
|
||||||
|
readAudio.close();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,19 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <ios>
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
std::fstream cv;
|
||||||
|
cv.open("currentVolume.txt", std::ios::out);
|
||||||
|
const unsigned short INCREMENT = 15;
|
||||||
|
unsigned short currentVolume = atoi(*(argv + 1));
|
||||||
|
unsigned short newVolume = currentVolume + INCREMENT;
|
||||||
|
|
||||||
|
cv << newVolume;
|
||||||
|
std::cout << newVolume << std::endl;
|
||||||
|
|
||||||
|
cv.close();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Reference in New Issue
Block a user