AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Delphi Audiodatei (MP3) leiser werden lassen
Thema durchsuchen
Ansicht
Themen-Optionen

Audiodatei (MP3) leiser werden lassen

Ein Thema von wursthunter · begonnen am 9. Feb 2006 · letzter Beitrag vom 10. Feb 2006
Antwort Antwort
Wishmaster

Registriert seit: 14. Sep 2002
Ort: Steinbach, MB, Canada
301 Beiträge
 
Delphi XE2 Architect
 
#1

Re: Audiodatei (MP3) leiser werden lassen

  Alt 10. Feb 2006, 01:21
Hi


Der Folgende Code hatte ich mal für Bass v 2.1 geschrieben.

Delphi-Quellcode:
 Private
 Cur_Volume : Single;
 FFadeOut : Boolean;
 FFadeIn : Boolean;
 FFadeTime : LongInt;




//------------- Fade in / Out
 if (FFadeOut) and (Get_SongLen - Get_PlayTime < FFadeTime) then
    Cur_Volume:= 100 * ((Get_SongLen - Get_PlayTime) / FFadeTime)
  else
    Cur_Volume:= 100;

 if (FFadeIn) and (Get_PlayTime < FFadeTime) then
     Cur_Volume:= 100 * (Get_PlayTime / FFadeTime)
    else
  if not (FFadeOut) then
     Cur_Volume:= 100;

  if Cur_Volume > 100 then Cur_Volume:= 100;
  if Cur_Volume < 0 then Cur_Volume:= 0;

  BASS_ChannelSetAttributes(Channel, -1, Trunc(Cur_Volume), trunc(Cur_Panning));

  

{-------------------------------- Volume --------------------------------------}

//This function affects the volume level of all applications using the same output device
//The volume level... 0 (min) - 100
Procedure TAudioEngine.Set_MainVolume(Value : WORD);
Begin
   if Value < 0 then Value:= 0;
   if Value > 100 then Value:= 100;
   if BASS_SetVolume(Value) then
      Cur_Volume:= Value;
end;


en Example aus der Bass Hilfe

Zitat:
Fadeout a channel's volume over a period of 1 second.
BASS_ChannelSlideAttributes(channel,-1,0,-101,1000);



BOOL WINAPI BASS_ChannelSlideAttributes(
DWORD handle,
int freq,
int volume,
int pan,
DWORD time
);

Parameters

handle The channel handle... a HCHANNEL, HSTREAM or HMUSIC.

freq The sample rate... 100 (min) - 100000 (max), -1 = leave current.
volume The volume... 0 (silent) - 100 or what's been set with the BASS_CONFIG_MAXVOL config option (max), -1 = leave current, -2 = fade to 0 and stop the channel.
pan The panning position... -100 (left) - 100 (right), -101 = leave current.
time
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:31 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz