Skocz do zawartości

Dołącz do społeczności!

👋 Witaj na MPCForum!

Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

  • ✅ Pełny dostęp do działów i ukrytych treści
  • ✅ Możliwość pisania i odpowiadania w tematach
  • ✅ System prywatnych wiadomości
  • ✅ Zbieranie reputacji i rozwijanie swojego profilu
  • ✅ Członkostwo w jednej z największych społeczności graczy

👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

Zarejestruj się teraz

[Pytanie] Odtwarzacz Mp3/Wav

Rekomendowane odpowiedzi

Opublikowano

Z nudów zacząłem pisać Odtwarzacz MP3 w AutoIt.

Możecie sobie go ściągnąć stąd (skrypt .au3 i kilka obrazków do GUI)

 

Trochę prymitywny ale zamierzam wypuścić nową wersje (już bez source :P) dzięki której będzie można odtwarzać MP3, WAV, oglądać filmy AVI i MPEG.

 

 

PS. Nie będę skanować bo mi się nie chcę ;] Musi Wam wystarczyć moje słowo że nie ma tam żadnych wirusów (bo po co...) :P

Opublikowano

Program czyściutki.

Wyręczyłem cię i daje skana ;)

http://www.virustotal.com/file-scan/report.html?id=488ff21a30b418e90675db9415f0086f8732b480df5d5e955241e844a8cfd8cc-1283110559

 

@edit

Programik fajny, tylko dobrze by było gdyby można było dodać listę mp3 które ma odtwarzać po kolei ;)

Chociaż trochę kombinowania będzie :P

 

@edit2

A da się tak zrobić, żeby odtwarzał np. radio internetowe? Rozszerzenie .pls chyba ^_^

Dumny członek MPCforum od 09 czerwca 2009 ;)

Opublikowano

podaj zrodlo (scrypt) odtwazacza bo na tym polega to forum :D

Administrator Priv-Crafting

admh.png

 

Administrator GCraftt

Administrator TheEscape

Opublikowano

Przecież możesz sobie ściągnąć i jest :) Nie skompilował skryptu ;)

No, ale podam :)

 

 

#include <Sound.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("MPC Player", 337, 131, 192, 124)
$Pic1 = GUICtrlCreatePic(@ScriptDir & "\tlo121.bmp", 0, 0, 404, 132, 0)
$Graphic1 = GUICtrlCreateGraphic(400, 0, 17, 129)
$Graphic2 = GUICtrlCreateGraphic(0, 128, 408, 24)
$MPClink = GUICtrlCreateButton("lolol", 0, 64, 201, 65, $BS_BITMAP)
GUICtrlSetImage(-1, @ScriptDir & "/btnmpclink.bmp", -1)
$glosnosc = GUICtrlCreateSlider(208, 112, 113, 17)
GUICtrlSetColor(-1, 0x70B1EB)
$nazwa = GUICtrlCreateEdit("", 8, 8, 193, 17)
GUICtrlSetData(-1, "")
$Start = GUICtrlCreateButton("Start", 208, 56, 57, 25)
$Stop = GUICtrlCreateButton("Stop", 272, 56, 57, 25)
$Wybierz = GUICtrlCreateButton("Wybierz", 8, 32, 193, 25)
$czas = GUICtrlCreateEdit("00:00:00", 208, 24, 124, 17)
GUICtrlSetData(-1, "00:00:00")
GLOBAL $Wybrany
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
MsgBox(0,"MPC Player","Odtwarzacz MP3/WAV by Leet Jan")
While 1
$glosnoscp = SoundSetWaveVolume(GUICtrlRead($glosnosc))
$czasp = _SoundPos($Wybrany)
GUICtrlSetData($czas, $czasp)
$nMsg = GUIGetMsg()
If $nMsg = $Wybierz Then
	$Wybrany = FileOpenDialog("Wybierz plik:", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "(*.mp3;*.wav)")
GUICtrlSetData($nazwa, $Wybrany)
EndIf
If $nMsg = $Start Then
_SoundPlay($Wybrany)
EndIf
If $nMsg = $Stop Then
_SoundPause($Wybrany)
EndIf

Switch $nMsg

	Case $GUI_EVENT_CLOSE
		Exit

EndSwitch
WEnd

 

Dumny członek MPCforum od 09 czerwca 2009 ;)

Opublikowano

jak ty to robiles jestes poczatkujacy i umiesz zrobic odtwarzacz :huh:

ja ucze sie juz 3 mies i ledwo zrobie taki program lol :D

 

 

Pdzieki za kod

Administrator Priv-Crafting

admh.png

 

Administrator GCraftt

Administrator TheEscape

Opublikowano
  • Autor

Na jakich podstawach wnioskujesz że jestem początkujący? Mała ilość postów? xD

Ale masz racje - jestem początkujący, dam Ci małą rade...

 

Analizuj kody innych

Opublikowano
Analizuj kody innych

Dokładnie :D

Ja się tak najwięcej uczę. Więcej niż z tutoriali ;)

Dumny członek MPCforum od 09 czerwca 2009 ;)

Opublikowano

Ja tam przeciesz tez sie ucze ja tam tutkow nawet nie czytam bo mi to nie pomaga ;P

Administrator Priv-Crafting

admh.png

 

Administrator GCraftt

Administrator TheEscape

Opublikowano

Ten program w sam raz dla początkującego (ile ? 40 liijek ? w tym 30 gui tworzone w kodzie

 

artkup pisz programy to się nauczysz , jakies kalkulatory , shutdownery spamboty szyfratory....

Opublikowano

Eh... ja tez sie przeciesz ucze i ja tam gustuje w botach :D

Administrator Priv-Crafting

admh.png

 

Administrator GCraftt

Administrator TheEscape

Opublikowano

super program tylko fajnie by bylo zeby mozna bylo dac kilka piosenek jak to zrobic? bo dziala tylko na jedna:d

Do
$wiek+=1
Until ŻycieGetMsg() = -3

zbieram +

Opublikowano

fajny :) dobra by była opcja listy odtwarzania :P i np odtwarzania plików po przeniesieniu ich na okno programu :P + poleciał ;>

 

zająłem się nim troszke :) więcej info -> spoiler

 

Zedytowałem odtwarzacz ... usunąłem napis mpcforum i zmieniłem tło na lepsze :)

 

DOWNLOAD

http://www.speedyshare.com/files/24038047/Odtwarzacz_by_Leet_Jan_edit_grafiki_by_olokos1.zip

 

SKAN spakowanych plików

http://www.virustotal.com/file-scan/report.html?id=35f100072f96969f646b218849db5e4c0818ec35fb37c570074fefe58d02271c-1283179553

 

SKAN pliku exe

http://www.virustotal.com/file-scan/report.html?id=c03b7846c19443422ee2abd87dd744a869ff04fcd42e07cd44e6ba77dbddc46e-1283179714

 

SKAN pliku au3

http://www.virustotal.com/file-scan/report.html?id=8e9d204aadea088c52fc377195412b6890184f8c625025640ce51560e4551168-1283179853

 

nie wiem dlaczego wykrywa wirusa... nie no bez jaj... plik au3 jest czysty a exe juz nie...

 

 

Opublikowano

GUI to nie problem ale lista odtwarzania to juz ciekawsze zajecie:P

Do
$wiek+=1
Until ŻycieGetMsg() = -3

zbieram +

Opublikowano
  • Autor

Mam prawie skończoną v2 która dodaje m. in. przenoszenie się do dowolnej sekundy/minuty/godziny utworu którego słuchamy, odtwarzanie filmów (niestety tylko *.avi, tylko ten typ ma wsparcie w AutoIt. Oczywiście są biblioteki które dodają inne rozszerzenia, ale nie chciało mi się ich szukać :P), et ceterum.

 

Ale nadal nie umiem zrobić listy odtwarzań. Wiem że muszę zrobić to z tablicami (array) ale akurat to w AutoIt o wiele różni się z C++, a przykłady z HelpFile u mnie nawet nie działają...

Opublikowano

łap i sie ciesz ;)

2 h temu wzieło mnie też na samograja ale to nie ma sęsu i daje sobie z tym spokój.

podejrzewam ze ci przypasuje.

w 2 wersjach różniących sie tylko 2 liniami kodu.

to:
$FileList = _FileListToArray($var)
zamiast tego:
$FileList = _FileListToArrayEx($var , "*.*", 1, -1,  True,  True)

i

to 
$sound = _SoundOpen($var & "\" & $FileList[$idx])
zamiast tego:
$sound = _SoundOpen($FileList[$idx])

 

#include <GUIConstantsEx.au3>
#include <TreeviewConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>
#include <Sound.au3>

Global $FileList, $TreeItem, $var, $idx
Global $label, $bution, $progress, $TreeView, $gui
Global $sound
Dim $TreeItem[65025]

$gui = GUICreate("nev_winamp pro mega elo wersja zlota edycja", 400, 450)
$TreeView = GUICtrlCreateTreeView(20, 20, 350, 350, BitOR($TVS_HASLINES, $TVS_LINESATROOT, $TVS_CHECKBOXES), $WS_EX_CLIENTEDGE)
$progress = GUICtrlCreateProgress(20, 380, 350, 20)
GUICtrlSetLimit(-1, 100, 0)
$bution = GUICtrlCreateButton("Play", 20, 410, 80, 35)
$label = GUICtrlCreateLabel("= = = = = = = = = =", 110, 420, 380, 20)
GUICtrlSetFont(-1, 12, 800)
GUISetState(@SW_SHOW)

$var = FileSelectFolder("odszukaj folder z mp3.", "", "", "", $gui)
GUICtrlSetData($label, "Szukam...")
$FileList = _FileListToArray($var)

GUICtrlSetData($label, "Znaleziono " & $FileList[0] & " pliki.")

For $idx = 1 To $FileList[0]
$TreeItem[$idx] = GUICtrlCreateTreeViewItem($FileList[$idx], $TreeView)
GUICtrlSetState(-1, $GUI_CHECKED)
Next

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
	Case $GUI_EVENT_CLOSE
		Exit
	Case $bution
		Call("Play")
EndSwitch

Sleep(20)
WEnd

Func Play()
Local $dlugosc, $czas, $uplynelo, $idx

For $idx = 1 To $FileList[0]
	GUICtrlSetBkColor($TreeItem[$idx], 0x00ff00)

	if (GUICtrlRead($TreeItem[$idx]) = $GUI_CHECKED) Then
		GUICtrlSetBkColor($TreeItem[$idx], 0xffb366)
		$sound = _SoundOpen($var & "\" & $FileList[$idx])
		_SoundPlay($sound);, 1)
		$dlugosc = _SoundLength($sound, 2)
		$czas = 100 / $dlugosc
		Do
			$uplynelo = _SoundPos($sound, 2)
			Sleep(200)
			;ZAMIAST SLEEP MOZNA TU UMIESCIĆ NP PĘTLE SPRAWDZAJACA GUZIKI (PAUZE, WYLACZANIA, NOWA LISTA, ECT) LUB JAKIS "NAPED OD WIZUALIZACJI"
			GUICtrlSetData($label, "dlugosc: " & Floor($dlugosc / 1000) & "sek.  uplynelo:" & Floor($uplynelo / 1000) & "sek.")
			GUICtrlSetData($progress, ($czas * $uplynelo))
		Until $uplynelo >= $dlugosc
		GUICtrlSetBkColor($TreeItem[$idx], 0x00ff00)
		_SoundClose($sound)
	EndIf
Next
EndFunc   ;==>Play

 

 

#include <GUIConstantsEx.au3>
#include <TreeviewConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>
#include <Sound.au3>

Global $FileList, $TreeItem, $var, $idx
Global $label, $bution, $progress, $TreeView, $gui
Global $sound
Dim $TreeItem[65025]

$gui = GUICreate("nev_winamp pro mega elo wersja zlota edycja", 400, 480)
$TreeView = GUICtrlCreateTreeView(20, 20, 350, 350, BitOR($TVS_HASLINES, $TVS_LINESATROOT, $TVS_CHECKBOXES), $WS_EX_CLIENTEDGE)
$progress = GUICtrlCreateProgress(20, 380, 350, 20)
GUICtrlSetLimit(-1, 100, 0)
$bution = GUICtrlCreateButton("Play", 20, 410, 80, 35)
$label = GUICtrlCreateLabel("= = = = = = = = = =", 110, 420, 380, 20)
GUICtrlSetFont(-1, 12, 800)
$glosnosc = GUICtrlCreateSlider(20, 450, 200, 17)
GUICtrlSetLimit(-1, 100, 0)
GUICtrlSetData(-1, 15)

GUISetState(@SW_SHOW)

$var = FileSelectFolder("odszukaj folder z mp3.", "", "", "", $gui)
GUICtrlSetData($label, "Szukam...")
;$FileList = _FileListToArray($var)
$FileList = _FileListToArrayEx($var , "*.*", 1, -1,  True,  True)

GUICtrlSetData($label, "Znaleziono " & $FileList[0] & " pliki.")

For $idx = 1 To $FileList[0]
$TreeItem[$idx] = GUICtrlCreateTreeViewItem($FileList[$idx], $TreeView)
GUICtrlSetState(-1, $GUI_CHECKED)
Next

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
	Case $GUI_EVENT_CLOSE
		Exit
	Case $bution
		Call("Play")
EndSwitch

Sleep(20)
WEnd

Func Play()
Local $dlugosc, $czas, $uplynelo, $idx
Local $glosnosc_korekta = 0
For $idx = 1 To $FileList[0]
	GUICtrlSetBkColor($TreeItem[$idx], 0x00ff00)

	if (GUICtrlRead($TreeItem[$idx]) = $GUI_CHECKED) Then
		GUICtrlSetBkColor($TreeItem[$idx], 0xffb366)
		;$sound = _SoundOpen($var & "\" & $FileList[$idx])
		$sound = _SoundOpen($FileList[$idx])
		_SoundPlay($sound);, 1)
		$dlugosc = _SoundLength($sound, 2)
		$czas = 100 / $dlugosc
		Do
			Sleep(200)
			$uplynelo = _SoundPos($sound, 2)
			If GUICtrlRead($glosnosc) <> $glosnosc_korekta Then
				$glosnosc_korekta = GUICtrlRead($glosnosc)
				SoundSetWaveVolume($glosnosc_korekta)
			EndIf
			;ZAMIAST SLEEP MOZNA TU UMIESCIĆ NP PĘTLE SPRAWDZAJACA GUZIKI (PAUZE, WYLACZANIA, NOWA LISTA, ECT) LUB JAKIS "NAPED OD WIZUALIZACJI"
			GUICtrlSetData($label, "dlugosc: " & Floor($dlugosc / 1000) & "sek.  uplynelo:" & Floor($uplynelo / 1000) & "sek.")
			GUICtrlSetData($progress, ($czas * $uplynelo))
		Until $uplynelo >= $dlugosc
		GUICtrlSetBkColor($TreeItem[$idx], 0x00ff00)
		_SoundClose($sound)
	EndIf
Next
EndFunc   ;==>Play

;===============================================================================
;
; Description:    lists all or preferred files and or folders in a specified path (Similar to using Dir with the /B Switch)
; Syntax:          _FileListToArrayEx($sPath, $sFilter = '*.*', $iFlag = 0, $sExclude = '')
; Parameter(s):     $sPath = Path to generate filelist for
;                   $sFilter = The filter to use. Search the Autoit3 manual for the word "WildCards" For details, support now for multiple searches
;                           Example *.exe; *.txt will find all .exe and .txt files
;                  $iFlag = determines weather to return file or folders or both.
;                   $sExclude = exclude a file from the list by all or part of its name
;                           Example: Unins* will remove all files/folders that start with Unins
;                       $iFlag=0(Default) Return both files and folders
;                      $iFlag=1 Return files Only
;                       $iFlag=2 Return Folders Only
;
; Requirement(s):   None
; Return Value(s):  On Success - Returns an array containing the list of files and folders in the specified path
;                       On Failure - Returns the an empty string "" if no files are found and sets @Error on errors
;                       @Error or @extended = 1 Path not found or invalid
;                       @Error or @extended = 2 Invalid $sFilter or Invalid $sExclude
;                      @Error or @extended = 3 Invalid $iFlag
;                       @Error or @extended = 4 No File(s) Found
;
; Author(s):        SmOke_N
; Note(s):          The array returned is one-dimensional and is made up as follows:
;                   $array[0] = Number of Files\Folders returned
;                   $array[1] = 1st File\Folder
;                   $array[2] = 2nd File\Folder
;                   $array[3] = 3rd File\Folder
;                   $array[n] = nth File\Folder
;
;                   All files are written to a "reserved" .tmp file (Thanks to gafrost) for the example
;                   The Reserved file is then read into an array, then deleted
;===============================================================================


Func _FileListToArrayEx($s_path, $s_mask = "*.*", $i_flag = 0, $s_exclude = -1, $f_recurse = True, $f_full_path = True)

   If FileExists($s_path) = 0 Then Return SetError(1, 1, 0)

   ; Strip trailing backslash, and add one after to make sure there's only one
   $s_path = StringRegExpReplace($s_path, "[\\/]+\z", "") & "\"

   ; Set all defaults
   If $s_mask = -1 Or $s_mask = Default Then $s_mask = "*.*"
   If $i_flag = -1 Or $i_flag = Default Then $i_flag = 0
   If $s_exclude = -1 Or $s_exclude = Default Then $s_exclude = ""

   ; Look for bad chars
   If StringRegExp($s_mask, "[/:><\|]") Or StringRegExp($s_exclude, "[/:><\|]") Then
       Return SetError(2, 2, 0)
   EndIf

   ; Strip leading spaces between semi colon delimiter
   $s_mask = StringRegExpReplace($s_mask, "\s*;\s*", ";")
   If $s_exclude Then $s_exclude = StringRegExpReplace($s_exclude, "\s*;\s*", ";")

   ; Confirm mask has something in it
   If StringStripWS($s_mask, 8) = "" Then Return SetError(2, 2, 0)
   If $i_flag < 0 Or $i_flag > 2 Then Return SetError(3, 3, 0)

   ; Validate and create path + mask params
   Local $a_split = StringSplit($s_mask, ";"), $s_hold_split = ""
   For $i = 1 To $a_split[0]
       If StringStripWS($a_split[$i], 8) = "" Then ContinueLoop
       If StringRegExp($a_split[$i], "^\..*?\..*?\z") Then
           $a_split[$i] &= "*" & $a_split[$i]
       EndIf
       $s_hold_split &= '"' & $s_path & $a_split[$i] & '" '
   Next
   $s_hold_split = StringTrimRight($s_hold_split, 1)
   If $s_hold_split = "" Then $s_hold_split = '"' & $s_path & '*.*"'

   Local $i_pid, $s_stdout, $s_hold_out, $s_dir_file_only = "", $s_recurse = "/s "
   If $i_flag = 1 Then $s_dir_file_only = ":-d"
   If $i_flag = 2 Then $s_dir_file_only = ""
   If Not $f_recurse Then $s_recurse = ""

   $i_pid = Run(@ComSpec & " /c dir /b " & $s_recurse & "/a" & $s_dir_file_only & " " & $s_hold_split, "", @SW_HIDE, 4 + 2)

   While 1
       $s_stdout = StdoutRead($i_pid)
       If @error Then ExitLoop
       $s_hold_out &= $s_stdout
   WEnd

   $s_hold_out = StringRegExpReplace($s_hold_out, "\v+\z", "")
   If Not $s_hold_out Then Return SetError(4, 4, 0)

   ; Parse data and find matches based on flags
   Local $a_fsplit = StringSplit(StringStripCR($s_hold_out), @LF), $s_hold_ret
   $s_hold_out = ""

   If $s_exclude Then $s_exclude = StringReplace(StringReplace($s_exclude, "*", ".*?"), ";", "|")

   For $i = 1 To $a_fsplit[0]
       If $s_exclude And StringRegExp(StringRegExpReplace( _
           $a_fsplit[$i], "(.*?[\\/]+)*(.*?\z)", "\2"), "(?i)\Q" & $s_exclude & "\E") Then ContinueLoop
       If StringRegExp($a_fsplit[$i], "^\w:[\\/]+") = 0 Then $a_fsplit[$i] = $s_path & $a_fsplit[$i]
       If $f_full_path Then
           $s_hold_ret &= $a_fsplit[$i] & Chr(1)
       Else
           $s_hold_ret &= StringRegExpReplace($a_fsplit[$i], "((?:.*?[\\/]+)*)(.*?\z)", "$2") & Chr(1)
       EndIf
   Next

   $s_hold_ret = StringTrimRight($s_hold_ret, 1)
   If $s_hold_ret = "" Then Return SetError(5, 5, 0)

   Return StringSplit($s_hold_ret, Chr(1))
EndFunc

 

 

ten drugi jak by lepszy ale zależy co kto lubi

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.

Ostatnio przeglądający 0

  • Brak zarejestrowanych użytkowników przeglądających tę stronę.

Konto

Nawigacja

Skonfiguruj powiadomienia push w przeglądarce

Chrome (Android)
  1. Stuknij ikonę kłódki obok paska adresu.
  2. Stuknij Uprawnienia → Powiadomienia.
  3. Dostosuj swoje ustawienie.
Chrome (Komputer)
  1. Kliknij ikonę kłódki na pasku adresu.
  2. Wybierz Ustawienia witryny.
  3. Znajdź Powiadomienia i dostosuj swoje ustawienie.